[uClinux-dev] SIGALRM and msgrcv
RobertD at vantagecontrols.com
Tue Nov 19 19:59:54 EST 2002
I'm attempting to use SysV IPC message queues and I'd very much like
a timeout on the msgrcv function, so I'm trying to use setitimer to create
an alarm that will go off after my wait time to interrupt the msgrcv. Now,
my problem occurs when the timeout is very short, such as 10 milliseconds.
I'm still not totally clear on what's going on, but from what I've been able
to observe, occasionally, at about the timeout time, I receive a message
which exits msgrcv before the alarm. I then cancel the timer, process the
message, then set the timer, and do another msgrcv. It appears that during
that process, my alarm fires and is not handled, but gets put into the
signals pending mask before schedule() is called in the sys_msgrcv function.
What I then get is a sleeping process with a SIGALRM pending. If I send a
signal that I'm handling, such as SIGIO, then the process wakes up and
things are normal again. This is also true if a message is received.
I'm trying to figure out how to avoid this and still have a msgrcv
with a timeout - does anyone have any ideas on this? I would have thought
that the SIGALRM would get handled at some point (preferably as close to the
specified time as is convenient), but sadly it doesn't. Is this supposed to
be possible/valid under linux/uClinux?
MCF5272 processor on my own board
Thanks for any ideas or helpful hints!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the uClinux-dev