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-Thread: 103376,136c120daac2a1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news3.google.com!newshub.sdsu.edu!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: tasksing and TCP sockets Date: Tue, 31 Jan 2006 21:55:57 +0000 Organization: Pushface Message-ID: References: <1138659171.491931.322480@g49g2000cwa.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 1138744551 15013 62.49.19.209 (31 Jan 2006 21:55:51 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Tue, 31 Jan 2006 21:55:51 +0000 (UTC) Cancel-Lock: sha1:eDZIuu1Lw55Ajw7DaDFc20rO1sc= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news1.google.com comp.lang.ada:2727 Date: 2006-01-31T21:55:57+00:00 List-Id: "Dmitry A. Kazakov" writes: > On 30 Jan 2006 14:12:51 -0800, Rolf wrote: >> - I don't know much about sockets (or better I don't remember much). >> Does a waiting read (in the second task) block a write in the first >> task? > > Usually not. Note that you must wait not for a socket read, but for a > "variable-update" event from the middleware layer. _Something_ has to wait for a socket read! If you're writing your own 'middleware' (lower layers, anyway) that will be you. Windows is not wonderful for this sort of thing but I have not seen problems of the sort you describe with a task blocked on the read (input_t'Input) and other code (either another single task, or some sort of mutex) for output_t'Output. >> - what other hints can you give me? > > Never ever use UPD, avoid TCP_NO_DELAY with TCP/IP. The first is > unreliable for your purpose, the second quickly brings the network > down. Probably best to avoid these (I guess that UPD was a typo for UDP) at the start, but sometimes they are the appropriate solution. Not often, maybe.