From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,ca915a94b485c02,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-21 13:34:23 PST Path: archiver1.google.com!news1.google.com!sn-xit-03!supernews.com!freenix!fr.usenet-edu.net!usenet-edu.net!news.tele.dk!small.news.tele.dk!192.71.180.34!newsfeed1.swip.net!swipnet!nntpserver.swip.net!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn?= Lundin Subject: create safe timeout Newsgroups: comp.lang.ada User-Agent: KNode/0.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8Bit Message-ID: NNTP-Posting-Host: 213.101.77.113 X-Complaints-To: news-abuse@swip.net X-Trace: nntpserver.swip.net 1019421215 213.101.77.113 (Sun, 21 Apr 2002 22:33:35 MET DST) NNTP-Posting-Date: Sun, 21 Apr 2002 22:33:35 MET DST Organization: A Customer of Tele2 X-Sender: x-367446@d213-101-77-113.swipnet.se Date: Sun, 21 Apr 2002 22:33:11 +0200 Xref: archiver1.google.com comp.lang.ada:22871 Date: 2002-04-21T22:33:11+02:00 List-Id: 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