From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26516 invoked by alias); 7 Apr 2008 14:55:23 -0000 Received: (qmail 26505 invoked by uid 22791); 7 Apr 2008 14:55:23 -0000 X-Spam-Check-By: sourceware.org Received: from wr-out-0506.google.com (HELO wr-out-0506.google.com) (64.233.184.237) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 07 Apr 2008 14:55:05 +0000 Received: by wr-out-0506.google.com with SMTP id 57so1442155wri.12 for ; Mon, 07 Apr 2008 07:55:03 -0700 (PDT) Received: by 10.141.37.8 with SMTP id p8mr1502210rvj.178.1207580102459; Mon, 07 Apr 2008 07:55:02 -0700 (PDT) Received: by 10.141.83.16 with HTTP; Mon, 7 Apr 2008 07:55:02 -0700 (PDT) Message-ID: <3fea10110804070755x1ac37586v79010a8b4116f457@mail.gmail.com> Date: Mon, 07 Apr 2008 15:22:00 -0000 From: "Zhichao Hong" To: ecos-discuss@ecos.sourceware.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] pthread_kill and signal lost or pending? X-SW-Source: 2008-04/txt/msg00112.txt.bz2 I am having some confusion about how signals are handled in the POSIX layer. Basically, I am not sure whether signals can get lost or not in the eCos implementation. I created a producer and consumer threads. In the producer, I will increment a counter every time when pthread_kill is called. And in the consumer which is blocked on pselect with no signal blocking (zero signal masked), it also increment a counter whenever it receives a signal. I found, the producer called pthread_kill 20 times whereas the consumer only got it once or twice. This leads me to think the signals are either pending forever or lost. However, when I introduce a mailbox between the producer and consumer. Every time when the producer put the message in the mailbox and then signals the consumer. On the other side, consumer get a message and wait for the next signals. There are still less signals received than the ones sent (200 sent vs 5 received). But it seems that the consumer does manage to consume all the messages the producer sent even with many lost signals. Can anyone help explain why this odd behavior occurs? This is a ARM7TDMI micro. -- Zhichao Hong, CSDP zhichao.hong@computer.org -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss