comp.lang.ada
 help / color / mirror / Atom feed
From: howland.reston.ans.net!wupost!cs.utexas.edu!utnut!utcsri!csri.toronto.edu !blaak@gatech.edu  (Raymond Blaak)
Subject: Re: Tasking in Ada
Date: 15 Sep 93 13:47:45 GMT	[thread overview]
Message-ID: <1993Sep15.094745.16963@jarvis.csri.toronto.edu> (raw)

kgatlin@galaxy.csc.calpoly.edu (Kang Su Gatlin) writes:

>I have hit a snag with Ada.  I need to create dynamic tasks that know which
>task they are.
...
>I can't seem to find a way to pass information to tasks efficiently.  I want
>all the tasks to run simultaneously so that the creation and execution of
>the tasks can be done in t(1) time.  

>The only way I can think of how to do it is to loop through and create the 
>tasks but that is O(n) time.  Or I can create an array of tasks (if that is
>possible) but then how do I get information to the tasks with using the
>rendezvous mechanism (again O(n)).

If n is small, then looping through is probably the best way. If n is large
then consider the array of tasks as a tree (i.e. the children of task i are
tasks 2i and 2i+1) and have each task communicate the identities to its
children. This would give you O(log n) time. To start things off you would
need only to tell task 1 its identity.

At any rate, if your code is running on a serial machine, then simply looping
through is faster anyway, for there would be less parallelism being simulated
to assign the identities.

Cheers,
Ray
blaak@csri.toronto.edu

             reply	other threads:[~1993-09-15 13:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-09-15 13:47 howland.reston.ans.net!wupost!cs.utexas.edu!utnut!utcsri!csri.toronto.edu [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-09-17 14:37 Tasking in Ada Wes Groleau x1240 C73-8
1993-09-16 17:11 Wes Groleau x1240 C73-8
1993-09-15 18:51 Raymond Blaak
1993-09-15 17:34 Robert Kitzberger
1993-09-15 17:32 Mark A Biggar
1993-09-15 15:17 cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!howland.
1993-09-15  4:16 Kang Su Gatlin
replies disabled

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