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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8ab6ed0f71c479cd X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!v15g2000yqn.googlegroups.com!not-for-mail From: sjw Newsgroups: comp.lang.ada Subject: Re: API design problem - buffer scatter I/O Date: Sat, 22 Nov 2008 08:54:47 -0800 (PST) Organization: http://groups.google.com Message-ID: <7d7f214a-9060-483f-977f-a5305ed8be48@v15g2000yqn.googlegroups.com> References: NNTP-Posting-Host: 62.49.19.209 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1227372888 31384 127.0.0.1 (22 Nov 2008 16:54:48 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 22 Nov 2008 16:54:48 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v15g2000yqn.googlegroups.com; posting-host=62.49.19.209; posting-account=_RXWmAoAAADQS3ojtLFDmTNJCT0N2R4U User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us) AppleWebKit/525.26.2 (KHTML, like Gecko) Version/3.2 Safari/525.26.12,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:2751 Date: 2008-11-22T08:54:47-08:00 List-Id: On Nov 22, 4:05=A0pm, Maciej Sobczak wrote: > I have a problem finding the best, from the Ada point of view, > interface for the scatter I/O API. There is a binding in GCC 4.3.0 - Receive_Vector and Send_Vector. Not sure when this was introduced - wasn't in GNAT 3.16. I don't know how scatter-gather is canonically intended to be used, but one way that it would have been nice to use were we not stuck on a historic version of the compiler would be to cope with application- specific message headers - these are all 20 bytes, so we could have had a 20-byte header buffer and a channel-specific message buffer to great advantage. As it is, on TCP_NODELAY & UDP sockets, we have to: (a) prepare the message (b) prepare the header (including fields depending on the message) (c) concatenate the header and the message (d) send the message. Not cool.