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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: tasksing and TCP sockets Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1138659171.491931.322480@g49g2000cwa.googlegroups.com> Date: Wed, 1 Feb 2006 09:54:56 +0100 Message-ID: <1t2h1alxz3vsg$.16d1nu0pxejlh$.dlg@40tude.net> NNTP-Posting-Date: 01 Feb 2006 09:54:56 MET NNTP-Posting-Host: 5576026b.newsread2.arcor-online.net X-Trace: DXC=4Wk;oA:9WRXZ37ga[7:n919Q4_`Vj9NZZj5LgkU<7 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:2733 Date: 2006-02-01T09:54:56+01:00 List-Id: On Tue, 31 Jan 2006 21:55:57 +0000, Simon Wright wrote: > "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. It depends. The point is, that it should not the application task. Especially because socket I/O events are not directly mapped into application events, due to buffering. So if the application needs fresh data it can wait for a protected object, which state is changed by the reader task (the reader waits, of course.) However more often, when dealing with sensors and actors (which are continuous-state things), the application does not wait at all, but just takes the last available value. [ Quality of service checks, and generating consequent alarms is a middleware's responsibility. ] >>> - 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. Yes. Maybe off-topic, but. Multicasting finally came. Now there are viable alternatives to UDP. For example, PGM is a reliable multicasting protocol. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de