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,a0224dc3d1e52f3d X-Google-Attributes: gid103376,public From: dennison@telepath.com Subject: Re: Streams and Concurrency Date: 1998/12/30 Message-ID: <76dgdl$qle$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 427112061 References: <76c3tv$acs@bgtnsc02.worldnet.att.net> X-Http-Proxy: 1.0 x8.dejanews.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Wed Dec 30 15:21:27 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; I) Date: 1998-12-30T00:00:00+00:00 List-Id: In article <76c3tv$acs@bgtnsc02.worldnet.att.net>, "James S. Rogers" wrote: > would be the typical Ada 83 approach. The more modern, and > more efficient approach in Ada 95 is to have encapsulate the stream > in a protected object. All access will be correctly and effectively > controlled by the protected object mechanism. That's the first thing I thought of too. This solution protects the stream itself from corruption just fine. The problem is that it provides absolutely no protection for the *data* in the stream. If I do a 'Write of a record, that gets translated into *several* "Write" calls to the stream, not just one. There's nothing stopping another task from making a call to the stream's Write subprogram in the middle of my record's 'Write. There's nothing stopping the stream service task from calling the stream's Read procedure in the middle of my 'Write either. Making the stream a proteced object does nothing for me here. The design of streams makes this problem basicly intractable at any level but the client level. It can't be done just by adding code to the stream implementation. The sad thing is that this isn't even the biggest problem. The fun *really* starts when you want to read the data back in safely without blocking... -- T.E.D. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own