comp.lang.ada
 help / color / mirror / Atom feed
From: "SteveD" <nospam_steved94@attbi.com>
Subject: Re: Multitasking
Date: Sat, 07 Dec 2002 14:09:11 GMT
Date: 2002-12-07T14:09:11+00:00	[thread overview]
Message-ID: <binI9.62883$pN3.4692@sccrnsc03> (raw)
In-Reply-To: 8bRwOT7FACB@lemmies.lb.bawue.de

"arvids lemchens" <lemchens@lemmies.lb.bawue.de> wrote in message
news:8bRwOT7FACB@lemmies.lb.bawue.de...
[snip]
>
> Output is:
> -----
> Start Task S at:          46831
> Task S finished at        46891
> End Task S                46891
> Start Task U              46891
> Task S finished at        47011
> End Task U                47011
> -----
>
> Now i am wondering why the maintask is waiting for the completion of
> S and T and not going independent of them on?
>
While I'm not certain what you're expecting, the output is exactly what I
expect (and get on Gnat 3.15p on W2K).

During the rendevous, the part between "accept S" and "end S" in your task,
the environment task and Tc do not proceed independently.  If you want them
to do so change the code to look something like:

         select
            accept S (
                  D : in     Positive ) do
               Local_D := D;
            end S;
            delay Standard.Duration(Local_D);
            Put("Task S finished at ");
            Put(Long_Long_Integer(Seconds(Clock)));
            New_Line;
         or

where Local_D is defined as a Positive that is local to the task.

If you're wondering why the program doesn't terminate immediately, the
environment task will not terminate until the dependent tasks terminate,
which happens when your task finishes the delay.

SteveD

> Am i missing something fundamental about ada-tasks?
>
> If yes, what and how do i get them running independent?
>
> If it matters, i am using the linuxversion of gnat 3.14p.
>
>
> MvfG,
>
> Arvids
>
>
>
>





  reply	other threads:[~2002-12-07 14:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-07 12:16 Multitasking arvids lemchens
2002-12-07 14:09 ` SteveD [this message]
2002-12-09  7:43   ` Multitasking arvids lemchens
2002-12-07 14:10 ` Multitasking Michal Nowak
2002-12-09  9:57   ` Multitasking arvids lemchens
2002-12-09 22:27     ` Multitasking Michal Nowak
2002-12-07 21:33 ` Multitasking Dennis Lee Bieber
2002-12-08  0:17   ` Multitasking Dennis Lee Bieber
2002-12-09  9:54     ` Multitasking arvids lemchens
2002-12-09 20:48       ` Multitasking Dennis Lee Bieber
2002-12-11 12:45         ` Multitasking John English
2002-12-11 19:34           ` Multitasking Dennis Lee Bieber
replies disabled

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