comp.lang.ada
 help / color / mirror / Atom feed
* Ada tasks: processes or threads
@ 2002-03-13  2:35 Frank Christiny
  2002-03-13  2:45 ` Frank Christiny
  2002-03-13  3:13 ` Ted Dennison
  0 siblings, 2 replies; 7+ messages in thread
From: Frank Christiny @ 2002-03-13  2:35 UTC (permalink / raw)


Dear All,

      Correct me if I am wrong, but it seems to me, from a cursory
   research on the subject, that it depends entirely on the compiler, not
   the programmer, as to whether Ada tasks are spawned as child
   processes or as threads.  For example, DEC's Ada 3.5 for OpenVMS
   seems to be of the latter persuasion while OC Systems' PowerAda
   3.1 for AIX does the former.  Am I in the right track?

       What I am trying to discern is whether my version of Ada95,
   PowerAda 3.1, can do multithreading in the multithreaded
   environment of AIX if I so choose to or am I stuck with spawns
   only?  If I need to get me some special libraries in order to create
   threads, which are they and where do I find them?

Thanks!
--
Frank Christiny
Houston, TX






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Ada tasks: processes or threads
  2002-03-13  2:35 Ada tasks: processes or threads Frank Christiny
@ 2002-03-13  2:45 ` Frank Christiny
  2002-03-13  3:13 ` Ted Dennison
  1 sibling, 0 replies; 7+ messages in thread
From: Frank Christiny @ 2002-03-13  2:45 UTC (permalink / raw)


      Ooops!  I just found out OC Systems' compiler DOES map Ada
  tasks to AIX threads.  All I need to find out is whether this applies to
  all their versions of PowerAda...
--
Frank Christiny


"Frank Christiny" <fchristiny@houston.rr.com> wrote in message
news:eWyj8.80098$6j2.4551742@typhoon.austin.rr.com...
> Dear All,
>
>       Correct me if I am wrong, but it seems to me, from a cursory
>    research on the subject, that it depends entirely on the compiler, not
>    the programmer, as to whether Ada tasks are spawned as child
>    processes or as threads.  For example, DEC's Ada 3.5 for OpenVMS
>    seems to be of the latter persuasion while OC Systems' PowerAda
>    3.1 for AIX does the former.  Am I in the right track?
>
>        What I am trying to discern is whether my version of Ada95,
>    PowerAda 3.1, can do multithreading in the multithreaded
>    environment of AIX if I so choose to or am I stuck with spawns
>    only?  If I need to get me some special libraries in order to create
>    threads, which are they and where do I find them?
>
> Thanks!
> --
> Frank Christiny
> Houston, TX
>
>
>





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Ada tasks: processes or threads
  2002-03-13  2:35 Ada tasks: processes or threads Frank Christiny
  2002-03-13  2:45 ` Frank Christiny
@ 2002-03-13  3:13 ` Ted Dennison
  2002-03-14  4:49   ` Zach Swanson
  1 sibling, 1 reply; 7+ messages in thread
From: Ted Dennison @ 2002-03-13  3:13 UTC (permalink / raw)


Frank Christiny wrote:

>       Correct me if I am wrong, but it seems to me, from a cursory
>    research on the subject, that it depends entirely on the compiler, not
>    the programmer, as to whether Ada tasks are spawned as child
>    processes or as threads.  For example, DEC's Ada 3.5 for OpenVMS


For that matter, every Ada task can be simulated within a single OS 
process (and thread). In fact, that would probably be easier for a 
compiler to do than putting them in separate processes. I've worked with 
different compilers that took each approach.

>        What I am trying to discern is whether my version of Ada95,
>    PowerAda 3.1, can do multithreading in the multithreaded
That's a question for your vendor (or their docs).





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Ada tasks: processes or threads
  2002-03-13  3:13 ` Ted Dennison
@ 2002-03-14  4:49   ` Zach Swanson
  2002-03-14 13:24     ` Larry Kilgallen
  2002-03-14 18:15     ` Ted Dennison
  0 siblings, 2 replies; 7+ messages in thread
From: Zach Swanson @ 2002-03-14  4:49 UTC (permalink / raw)


Ted Dennison <dennison@telepath.com> wrote in message news:<3C8EC270.1030006@telepath.com>...
> Frank Christiny wrote:
> 
> >       Correct me if I am wrong, but it seems to me, from a cursory
> >    research on the subject, that it depends entirely on the compiler, not
> >    the programmer, as to whether Ada tasks are spawned as child
> >    processes or as threads.  For example, DEC's Ada 3.5 for OpenVMS
> >        What I am trying to discern is whether my version of Ada95,
> >    PowerAda 3.1, can do multithreading in the multithreaded


The Ada standard for tasks is a multi-thread implementation, not
multi-process. All threads belong to the parent process, which is the
main compilation unit.

Zach Swanson
USMA '02



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Ada tasks: processes or threads
  2002-03-14  4:49   ` Zach Swanson
@ 2002-03-14 13:24     ` Larry Kilgallen
  2002-03-15  5:24       ` Zach Swanson
  2002-03-14 18:15     ` Ted Dennison
  1 sibling, 1 reply; 7+ messages in thread
From: Larry Kilgallen @ 2002-03-14 13:24 UTC (permalink / raw)


In article <50c1a1b.0203132049.3c729ad0@posting.google.com>, x24702@usma.edu (Zach Swanson) writes:

> The Ada standard for tasks is a multi-thread implementation, not
> multi-process. All threads belong to the parent process, which is the
> main compilation unit.

Why do you say that ?

I was under the impression that notions of "threads" and "processes"
were operating system concepts invisible to the reader of the Ada
Reference Manual.

Obviously such concepts must be handled by those implementing an
Ada compiler, but their implementation should hide those details
from those writing Ada programs.

To the extent that any programmer depends on thread vs. process
differences, aren't they depending on features not guaranteed
by the Ada Reference Manual ?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Ada tasks: processes or threads
  2002-03-14  4:49   ` Zach Swanson
  2002-03-14 13:24     ` Larry Kilgallen
@ 2002-03-14 18:15     ` Ted Dennison
  1 sibling, 0 replies; 7+ messages in thread
From: Ted Dennison @ 2002-03-14 18:15 UTC (permalink / raw)


x24702@usma.edu (Zach Swanson) wrote in message news:<50c1a1b.0203132049.3c729ad0@posting.google.com>...
> The Ada standard for tasks is a multi-thread implementation, not
> multi-process. All threads belong to the parent process, which is the
> main compilation unit.


Errr, not exactly. 

Ada tasks were around before "threads" became a common OS concept. Ada
tasks are Ada tasks, period. However an implementation chooses to
implement them is entirely up to that implementation.

Due to the fact that they have to be able to share global data with
other tasks, it may *easier* to implement them using threads under
most of the big modern OS's. But to do so you have to be able to
follow all the other little Ada rules too. That's why the compliant
tasking runtime under Linux does *not* use OS threads.

Implementing tasks entirely in the Ada runtime within a single process
is a quite common method found on *many* compilers. I have also seen
implementations using OS threads, and using OS processes (all global
data was put in shared memory sections, which worked great, as long as
you didn't let an OS API allocate memory for you then try to use it in
another task...). On some RTOS's (eg: vxWorks), "processes" share a
single memory space, and the tasking executives can support all the
other niggling Ada task requirements, so Ada compilers on those
platforms have little trouble using OS processes.


-- 
T.E.D. 
Home     -  mailto:dennison@telepath.com (Yahoo: Ted_Dennison)
Homepage -  http://www.telepath.com/dennison/Ted/TED.html



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Ada tasks: processes or threads
  2002-03-14 13:24     ` Larry Kilgallen
@ 2002-03-15  5:24       ` Zach Swanson
  0 siblings, 0 replies; 7+ messages in thread
From: Zach Swanson @ 2002-03-15  5:24 UTC (permalink / raw)


Kilgallen@SpamCop.net (Larry Kilgallen) wrote in message news:<bi2LAn0DrQcb@eisner.encompasserve.org>...
> Why do you say that ?
> 
> I was under the impression that notions of "threads" and "processes"
> were operating system concepts invisible to the reader of the Ada
> Reference Manual.
> 
> Obviously such concepts must be handled by those implementing an
> Ada compiler, but their implementation should hide those details
> from those writing Ada programs.
> 
> To the extent that any programmer depends on thread vs. process
> differences, aren't they depending on features not guaranteed
> by the Ada Reference Manual ?

That's true, I should have said its an Ada "compiler standard" just
because that seems to be how the majority of the Ada compilers handle
the tasks, as "threads". And as Ted pointed out a post later, its not
so much an OS thread either.

And you're right about depending on thread vs process, there's really
no way to guarantee that from the LRM, its compiler dependant.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-03-15  5:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-13  2:35 Ada tasks: processes or threads Frank Christiny
2002-03-13  2:45 ` Frank Christiny
2002-03-13  3:13 ` Ted Dennison
2002-03-14  4:49   ` Zach Swanson
2002-03-14 13:24     ` Larry Kilgallen
2002-03-15  5:24       ` Zach Swanson
2002-03-14 18:15     ` Ted Dennison

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