From: Hossein Mobahi <hmobahi@yahoo.com>
To: linux-c-programming@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Race: SignalHandler() & sleep()
Date: Tue, 4 Jun 2002 07:48:04 -0700 (PDT) [thread overview]
Message-ID: <20020604144804.33629.qmail@web12706.mail.yahoo.com> (raw)
Hello
main()
{
....
signal (SIGIO, signalhandler() ) ;
....
sleep (65535) ;
....
}
signalhandler() { ... }
Assume the frequency of IO events is faster than one
event per 65535 seconds. Therefore, let's consider
65535 as infinity (sleeping foreveR).
If a SIGIO arrives, main will get out of sleep and
continue running, but signalhandler will be invoked
too. I wanted to know if there is any order/priority
for sleep() in main, and signalhandler() to be called
first, or one of them is invoked first randomly (race
condition) ?
I myself ran the program many times and everytime
observed signalhandler responding first. But maybe it
is not a rule, and it was just my chance ?
Thnx for your comment !
--Hossein Mobahi
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
next reply other threads:[~2002-06-04 14:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-04 14:48 Hossein Mobahi [this message]
2002-06-04 22:24 ` Race: SignalHandler() & sleep() george anzinger
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=20020604144804.33629.qmail@web12706.mail.yahoo.com \
--to=hmobahi@yahoo.com \
--cc=linux-c-programming@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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 NNTP newsgroup(s).