comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Multitasking theory question
Date: 20 Jun 2002 16:53:47 -0400
Date: 2002-06-20T21:01:26+00:00	[thread overview]
Message-ID: <uu1nxr7s4.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 3d123f34.0@news.unibw-muenchen.de

"Kai Schuelke" <kai.schuelke@gmx.net> writes:

> Hello,
> 
> during my programming course we learned about tasks, too. One qustion that
> couldn't be answered was:
> 
> Is an Ada-Task a process of the operating system or is it a kind of process
> inside the whole program?

This is not defined by the language. It is up to the implementation,
and both approaches have been taken.

Most Ada 95 compilers use OS threads for Ada tasks, if the OS supports
threads. This is simple, because threads within a process share an
address space, as Ada tasks do.

> I tend to agree with the second opinion, based on what I have seen
> during some personal "experiments". But it seems to depend on how
> the compiler handles the tasks. The example consisted of two tasks.
> In one case, using DOS and an old Ada83 compiler the second task
> never could do anything, because all resources (CPU-Time) where
> blocked by Task #1. The same code run in a WinNT DOS-Box and
> compiled with the actual Aonix compiler switched between the task
> with intervals of about 1 second.

This is addressing a different question; whether the runtime supports
preemption. Since DOS is neither multi-processing nor multi-threaded,
this is not surprising.

> Under DOS tasks ran cooperative, under Win preemtive. Why this
> difference? Is it because of the OS, the compiler or the change from
> Ada83 to Ada95?

The OS.

-- 
-- Stephe



  reply	other threads:[~2002-06-20 20:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-20 20:46 Multitasking theory question Kai Schuelke
2002-06-20 20:53 ` Stephen Leake [this message]
2002-06-21  2:13 ` Ted Dennison
2002-06-24  3:18   ` AG
2002-06-24  4:13     ` tmoran
2002-06-24  4:24       ` AG
2002-06-24  7:33         ` Dale Stanbrough
2002-06-25  3:27           ` AG
2002-06-25  4:48             ` tmoran
2002-06-25  5:00               ` AG
2002-06-25  5:17               ` Darren New
2002-06-25  5:25                 ` AG
2002-06-24  5:43     ` Mark Biggar
2002-06-24  6:48       ` AG
2002-06-24 15:14         ` Darren New
2002-06-24 16:19           ` Larry Kilgallen
2002-06-25  2:01           ` AG
2002-06-25  3:21             ` Darren New
2002-06-25  4:01               ` AG
2002-06-25  4:19                 ` Darren New
2002-06-25  4:51                   ` AG
2002-06-26  1:58                     ` Darren New
replies disabled

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