comp.lang.ada
 help / color / mirror / Atom feed
From: "Hibou57 (Yannick Duchêne)" <yannick_duchene@yahoo.fr>
Subject: Re: Maping of Ada tasks on the plateforme OS threads model
Date: Mon, 29 Jun 2009 13:56:13 -0700 (PDT)
Date: 2009-06-29T13:56:13-07:00	[thread overview]
Message-ID: <073575da-8319-4b6a-a41f-a03c736ebad6@37g2000yqp.googlegroups.com> (raw)
In-Reply-To: 2b0f1f6b-51b2-45be-bcd9-85f2d6a389d9@t13g2000yqt.googlegroups.com

On 28 juin, 18:31, sjw <simon.j.wri...@mac.com> 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.



  reply	other threads:[~2009-06-29 20:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-28  0:35 Maping of Ada tasks on the plateforme OS threads model Hibou57 (Yannick Duchêne)
2009-06-28 16:31 ` sjw
2009-06-29 20:56   ` Hibou57 (Yannick Duchêne) [this message]
2009-06-29 22:45     ` coroutines (Maping of Ada tasks on the plateforme OS threads model) Georg Bauhaus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox