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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,71daebeb6145ebb6 X-Google-Attributes: gid103376,public From: robert_dewar@my-dejanews.com Subject: Re: Stream venting (long) Date: 1998/12/29 Message-ID: <769g3r$moq$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 426621977 References: <768sng$6r9$1@nnrp1.dejanews.com> X-Http-Proxy: 1.0 x7.dejanews.com:80 (Squid/1.1.22) for client 166.72.71.176 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Tue Dec 29 02:51:39 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1998-12-29T00:00:00+00:00 List-Id: In article <768sng$6r9$1@nnrp1.dejanews.com>, dennison@telepath.com wrote: > 1. Stream 'Writes and 'Reads are inherently task > unsafe. Possible solution 1a: You can of course try > to implement your stream in a > task safe manner. But as a stream implementor all > you will see is a series of > Write calls. A single 'Write from the client will > cause an indeterminate number of these. There's no > way to tell if a Write or Read call is the first > or last in a series. If you need to make the enitre > composite type's 'Write or 'Read atomic, you're SOL. I find this complaint bizarre, I must not understand it properly. First, the idea of different tasks writing asynchronously to a common stream seems an entirely bizarre program organization. Second, if you really *do* want such an organization, it seems quite easy to program stream functions so that they are properly atomic. I see no difficulty in doing this. You just need a single lock, with a test that avoids messing with it if it is already set. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own