comp.lang.ada
 help / color / mirror / Atom feed
* Help needed with tasking
@ 1996-05-22  0:00 Richard Francis
  1996-05-22  0:00 ` Robert I. Eachus
  1996-05-23  0:00 ` Pascal Ledru
  0 siblings, 2 replies; 3+ messages in thread
From: Richard Francis @ 1996-05-22  0:00 UTC (permalink / raw)



I am writing a traffic lights sim using tasking. Can someone help me
with how tasks work? You can't call an entry from within another, is
that right? eg
task body a is
select
accept x do
--something
a.y;
end x;
or
accept y do
--something
end y;
end select;
end a;

what else can or can't you do?

-- 
Richard Francis

....as the elephant said to the naked man,
" Cute! But can it pick up peanuts?"....




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

* Re: Help needed with tasking
  1996-05-22  0:00 Help needed with tasking Richard Francis
@ 1996-05-22  0:00 ` Robert I. Eachus
  1996-05-23  0:00 ` Pascal Ledru
  1 sibling, 0 replies; 3+ messages in thread
From: Robert I. Eachus @ 1996-05-22  0:00 UTC (permalink / raw)



In article <31A33519.41C67EA6@diana1.cs.paisley.ac.uk> Richard Francis <com40008@diana1.cs.paisley.ac.uk> writes:

  > I am writing a traffic lights sim using tasking. Can someone help me
  > with how tasks work? You can't call an entry from within another, is
  > that right?

  Why not?  There is a rule in both Ada 83 and Ada 95 that you can't
have an accept statement nested inside another accept statement for
the same entry, but that's all.  (Well, Ada 83 had a "helpful" note
RM839.5(21), which probably caused more confusion than help. Most of
the note is gone from Ada 95.)

  > what else can or can't you do?

  Good question.  The answer used to be that you couldn't have the
same task queued calling two different entries, but Ada 95 fixed
that. (See RM95 9.7.4)   And yes I know that there is an
equivalent implementation that doesn't break the Ada 83 rule, but from
the programmer's point of view you can queue up for as many other
entries as you want. ;-) 

--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




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

* Re: Help needed with tasking
  1996-05-22  0:00 Help needed with tasking Richard Francis
  1996-05-22  0:00 ` Robert I. Eachus
@ 1996-05-23  0:00 ` Pascal Ledru
  1 sibling, 0 replies; 3+ messages in thread
From: Pascal Ledru @ 1996-05-23  0:00 UTC (permalink / raw)



Your question is very broad!
Lot of details about the tasking model (including protected objects)
can be found in "Concurrency in Ada" from Alan Burns and Andy Wellings
(Cambridge University Press)





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

end of thread, other threads:[~1996-05-23  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-05-22  0:00 Help needed with tasking Richard Francis
1996-05-22  0:00 ` Robert I. Eachus
1996-05-23  0:00 ` Pascal Ledru

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