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,8b7e315279c3f417 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.74.79 with SMTP id r15mr3281541wiv.4.1355764101467; Mon, 17 Dec 2012 09:08:21 -0800 (PST) X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 88.191.116.97 Path: i11ni203009wiw.0!nntp.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!nntpfeed.proxad.net!dedibox.gegeweb.org!gegeweb.eu!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Ada Library, called, returns and continues ? Date: Mon, 17 Dec 2012 17:08:20 +0000 Organization: A noiseless patient Spider Message-ID: References: <5ced9166-5a29-4ad2-8270-6d24ddd0d0a1@googlegroups.com> <1rz66cdo8v1hv.j9eyg9eqqide$.dlg@40tude.net> <87db4d95-56ce-4254-8031-7bbbea515ff3@googlegroups.com> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="2a5d6fb105b6730bdbc5ec48c6e18f59"; logging-data="20400"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19SVtCWs3N/he9dpxey5v/OmEJy55laXl8=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (darwin) Cancel-Lock: sha1:nvRN5WwbeGUvpw7mXsHCCQCLd8M= sha1:WXqdtq2xrcD2gjI7sxAEwwIW0SU= Content-Type: text/plain Date: 2012-12-17T17:08:20+00:00 List-Id: Patrick writes: > If a protected object and it's entries are bound to a C/C++ > application with it's own main, do you think the Ada threads will > begin when the C main is called or would I need to create an > initialization for them? If they just started, main C could call an > entry or If I used a protected record I could also access this as a > struct and retrieve data this way. Do you think I could send data back > and forth through the protected record? [1] tells how to bind (how to invoke gnatbind) for a non-Ada main program; this generates the necessary Ada elaboration code, and your C calls "adainit" to do the elaboration, start tasks etc. There's also an "adafinal", which I've never had occasion to call, and I believe you can get GNAT to use a different name if necessary. C can't call POs or task entries directly, you'd need to write Ada subprograms to do that and arrange to call them from the C. [1] http://docs.adacore.com/gnat-unw-docs/html/gnat_ugn_5.html#SEC70