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,fce935e9f3aa1da8 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Interfacing with C: access/out parameters Date: Tue, 31 Aug 2004 11:41:48 +0200 Message-ID: <2pivcgFl9kl2U1@uni-berlin.de> References: <2ph6fjFkpsahU1@uni-berlin.de> <_UKYc.2897$w%6.1362@newsread1.news.pas.earthlink.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de YV0awOgQVEnLs9uejcUKmQ7iRKEHAO4qp7eznkibSvg2iDXIk= User-Agent: Mozilla Thunderbird 0.7.1 (X11/20040626) X-Accept-Language: en-us, en In-Reply-To: <_UKYc.2897$w%6.1362@newsread1.news.pas.earthlink.net> Xref: g2news1.google.com comp.lang.ada:3201 Date: 2004-08-31T11:41:48+02:00 List-Id: Jeffrey Carter wrote: > 1. What are the explicit timing requirements for this software? > > 2. Does it fail to meet these requirements? > > 3. If so, is eliminating this assignment the only way to meet the timing > requirements? > > I have never encountered SW where these could all be answered "Yes". > > Probably you don't want your software to be using C-convention types for > anything except the interface to C, so you'd want your thick binding to > have an Ada-convention type for Datum, and assign the fields of Helper > to it. Horrors! Multiple assignments! Thanks for the responses and sorry for the error in the example. As you have already guessed, I want to get rid (if possible) of the copy. I can't say for sure that my soft answers "yes" to your three questions, but evaluate for yourself: I'm writing a (initially thin) binding for the Player/Stage robot server (http://playerstage.sf.net). The function we are talking about is a generic message passing one were messages are normally little (up to 8kB) but could be (almost) arbitrarily bigger. Message communication occurs at a configurable pace but the default is 10Khz if memory serves well. As you see, is a function which is used often, by other, more specialized communication functions. Being a binding, any code using it would pass by this "bottleneck". It's for these reasons that I would want to have the optimal high level solution, and eliminating the copy of the returned data seems a sensible desire. There is that mentioned Import_Valued_Procedure in Gnat which addresses this Ada shortcoming, but talking about a binding, I want it to be totally portable if possible. As per the C convention types all around the place, my intention is to build (if time permits) a thick binding over this thin binding, so that can be isolated later. Further ideas? Is there anything definitely unadvisable in my original solution? (The one using limited/tagged types and 'Address). Thanks!