public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Zhichao Hong" <zhichao.hong@gmail.com>
To: ecos-discuss@ecos.sourceware.org
Subject: [ECOS] pthread_kill and signal lost or pending?
Date: Mon, 07 Apr 2008 15:22:00 -0000	[thread overview]
Message-ID: <3fea10110804070755x1ac37586v79010a8b4116f457@mail.gmail.com> (raw)

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

             reply	other threads:[~2008-04-07 14:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-07 15:22 Zhichao Hong [this message]
2008-04-07 16:01 ` Nick Garnett
2008-04-07 16:30   ` Zhichao Hong
2008-04-07 16:36     ` Nick Garnett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3fea10110804070755x1ac37586v79010a8b4116f457@mail.gmail.com \
    --to=zhichao.hong@gmail.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).