comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Lundin" <bjorn.lundin@swipnet.se>
Subject: create safe timeout
Date: Sun, 21 Apr 2002 22:33:11 +0200
Date: 2002-04-21T22:33:11+02:00	[thread overview]
Message-ID: <zmFw8.2188$iB4.6157@nntpserver.swip.net> (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



                 reply	other threads:[~2002-04-21 20:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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