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: a07f3367d7,33e2ff06dc7f500c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!37g2000yqp.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: Maping of Ada tasks on the plateforme OS threads model Date: Mon, 29 Jun 2009 13:56:13 -0700 (PDT) Organization: http://groups.google.com Message-ID: <073575da-8319-4b6a-a41f-a03c736ebad6@37g2000yqp.googlegroups.com> References: <31491d36-18ec-4da4-b1a6-1914d0867492@b14g2000yqd.googlegroups.com> <2b0f1f6b-51b2-45be-bcd9-85f2d6a389d9@t13g2000yqt.googlegroups.com> NNTP-Posting-Host: 77.198.58.4 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1246308973 19262 127.0.0.1 (29 Jun 2009 20:56:13 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 29 Jun 2009 20:56:13 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 37g2000yqp.googlegroups.com; posting-host=77.198.58.4; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6733 Date: 2009-06-29T13:56:13-07:00 List-Id: On 28 juin, 18:31, sjw wrote: > If you are using GNAT, be aware of GNAT.Threads; on some operating > systems (VxWorks, for instance) you must call > GNAT.Threads.Register_Thread in Ada code called (via C, for example) > from an OS thread before you do anything involving the RTS (string > catenation, ...). Other compilers will have their own way of dealing > with this. I've never heard about VxWorks before. It is a real time OS, as said Yahoo search. A note on Windows which tells to be careful when using GetLastError: > It is not possible to use GetLastError and SetLastError when tasking, > protected records, or exceptions are used. In these cases, in order to > implement Ada semantics, the GNAT run-time system calls certain Win32 routines > that set the last error variable to 0 upon success. It should be possible to > use GetLastError and SetLastError when tasking, protected record, and > exception features are not used, but it is not guaranteed to work. http://www.adacore.com/wp-content/files/auto_update/gnat-unw-docs/html/gnat_ugn_36.html By the ways, I'm looking for the best way to do coroutines with Ada, without tasking (none-recursive coroutines, so no separate stack is needed, just global storage for local variables). Yes, this can be achieved with a select/when statement and a state enumeration, but this way is not very clean nor nice.