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,2cc84c0fee9046c0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.kolumbus.fi!feeder2.news.jippii.net!reader1.news.jippii.net!53ab2750!not-for-mail From: Tapio Kelloniemi Subject: Re: Various Language Architecture Questions References: Newsgroups: comp.lang.ada Message-ID: Date: Tue, 27 Sep 2005 07:18:43 GMT NNTP-Posting-Host: 217.30.176.187 X-Complaints-To: newsmaster@saunalahti.com X-Trace: reader1.news.jippii.net 1127805523 217.30.176.187 (Tue, 27 Sep 2005 10:18:43 EEST) NNTP-Posting-Date: Tue, 27 Sep 2005 10:18:43 EEST Organization: Saunalahti Customer Xref: g2news1.google.com comp.lang.ada:5175 Date: 2005-09-27T07:18:43+00:00 List-Id: Simon Wright wrote: >Florian Weimer writes: > >> * Maciej Sobczak: > >>> I guess that the time spent on the protocol stack and in all the network >>> equipment is much bigger than what is needed to construct a correct >>> packet, >> >> Unfortunately, this is not true for some commonly used marshaling >> schemes. Even Ada.Streams can be relatively slow (with long arrays >> with small components, for example). > >I've never understood why this _has_ to be. You would have thought >implementations could behave 'as if' to a large extent. If the stream >runs out of room or gets closed by peer I'm not sure that I care >exactly how many bytes got sent, do I? In some circumstances you might want to know that, for example when transferring critical data over unreliable network. Of course the protocol must understand resuming. But still this does not mean that stream elements must be written one by one (I suppose this is the problem why stream I/O is slow). read(2), write(2) and scatter-gather I/O (POSIX) functions can return the number of bytes transmitted even though they are fast. -- Tapio