comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Nettleton <bn@aonix.com>
To: Frank Ecke <franke@paxp01.mipool.uni-jena.de>
Subject: Re: ATC---The Holy Grail of Ada Tasking?
Date: 1998/07/08
Date: 1998-07-08T00:00:00+00:00	[thread overview]
Message-ID: <35A2C41D.F22CAE9E@aonix.com> (raw)
In-Reply-To: slrn6p3tph.q9p.franke@paxp01.mipool.uni-jena.de

Frank Ecke wrote:
> 
> I am currently trying to plunge into the details of ATC (asynchronous transfer
> of control) in Ada. Please consider the following scenario:
> 
>    Given a task, T, and a protected object, P (which owns an entry, E), let T
> execute the following ATC statement:
> 
>    select
>       P.E(...);
>    then abort
>       -- sequence of statements to be aborted upon completion of P.E
>    end select;
> 
> If the entry call is queued, then the abortable part is executed. If, then, the
> entry call can be accepted, the abortable part *and* the triggering statement
> are executed in parallel. Since T's thread of control is associated with the

It is not true that these are executed in parallel.  RM 9.7.4:6 says
that the abortable_part is never started if the entry call is accepted. 
The abortable_part is only executed if (or when) the entry becomes
queued (or requeued-with-abort).  No need for an extra thread.


> abortable part, another thread of control must be employed to execute P.E
> Accordingly, the Ada Standard allows that ``an implementation may perform the
> sequence of steps of a protected action using any thread of control; it need
> not be that of the task that started the protected action.'' (Section~9.5.3)
> Thus, for example, the thread of control of the main program or that of a
> client task engaged in a rendezvous could be used instead. There is, however,
> a question as to what should happen if all other existing threads of control
> are in use. Does ``... any thread of control ...'' mean that an implementation
> is allowed to introduce a new thread of control that executes P.E? And, if so,
> which entity in our sample program is this new thread of control considered to
> be associated with? Or is it deemed to be anonymous (since it will cease to
> exist when P.E completes)? Of course, since nested ATC is possible, the
> problem can be generalized to any (positive) number of threads of control.
> 
>    I am at the end of my wit and would be grateful if someone could help me
> with this problem (or debunk my misconception).
> 
> Thanks in advance,
> 
> Frank Ecke, franke@minet.uni-jena.de

-Brian Nettleton




       reply	other threads:[~1998-07-08  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <slrn6p3tph.q9p.franke@paxp01.mipool.uni-jena.de>
1998-07-08  0:00 ` Brian Nettleton [this message]
1998-07-08  0:00   ` ATC---The Holy Grail of Ada Tasking? Robert Dewar
1998-07-10  0:00     ` Frank Ecke
1998-07-10  0:00       ` Pat Rogers
1998-07-10  0:00       ` Frank Ecke
replies disabled

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