comp.lang.ada
 help / color / mirror / Atom feed
* create safe timeout
@ 2002-04-21 20:33 Björn Lundin
  0 siblings, 0 replies; only message in thread
From: Björn Lundin @ 2002-04-21 20:33 UTC (permalink / raw)


Hi all!
I'm using the messageboxes provided in unix sys V.
I want a process to wait for a message to arrive, and then
act upon the message. So I do pragma import with "msgget" and friends.
All is fine. But I also want the receiving process to be able
to time out after a while (if no message arrives). I used the 

select delay sometime
  raise timeout;
then abort
  receive_from_q;
end select

construction. But after a while, I realized that
if receive_from_q was not quite finished, but had 
removed a message from the queue, and the timer went out,
I could lose a message.

Now the question. What is the common way of solving this?
I temporarily solved it with a tasking solution, but 
it feels a bit clumpsy. 

Any ideas would be helpful.

/Bj�rn



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-04-21 20:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-21 20:33 create safe timeout Björn Lundin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox