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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,126ce244c524526b X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!news.highwinds-media.com!xara.net!gxn.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Tasking issues Date: Mon, 13 Aug 2007 20:54:53 +0100 Organization: Pushface Message-ID: References: <1186851804.567302.223160@q4g2000prc.googlegroups.com> <1186938729.414350.288620@d55g2000hsg.googlegroups.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1187034893 25820 62.49.19.209 (13 Aug 2007 19:54:53 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Mon, 13 Aug 2007 19:54:53 +0000 (UTC) Cancel-Lock: sha1:dxyoWO9TSpLoUzrAsF2kqMraY10= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (darwin) Xref: g2news2.google.com comp.lang.ada:1427 Date: 2007-08-13T20:54:53+01:00 List-Id: shaunpatterson@gmail.com writes: > I'd have to check, but I was SURE I set the GNAT Sockets to > non-blocking... which (I assume) would allow the other thread to > run. Do you mean you called GNAT.Sockets.Initialize (Process_Blocking_IO => True)? (it's a lot of work to set a socket non-blocking, I don't think you would easily forget). Not sure this has the effect you want. I would expect a read from a non-blocking socket that didn't have (enough) input to end with an End_Error exception usually .. or a Socket_Error with EWOULDBLOCK .. or, as someone else suggested, to eat CPU. Unless you really need to do otherwise it's easiest to use ordinary (blocking) IO on the sockets, one task to read from each socket. (You could check out GNAT.Sockets' Selector_Type & Socket_Set_Type).