comp.lang.ada
 help / color / mirror / Atom feed
* Ada tasking question.
@ 1996-10-18  0:00 whiting_ms@corning.com (Matt Whiting)
  0 siblings, 0 replies; 20+ messages in thread
From: whiting_ms@corning.com (Matt Whiting) @ 1996-10-18  0:00 UTC (permalink / raw)




I'm just learning Ada and am completely unfamiliar with any implementation
details of various Ada compilers/run-time environments.  I'm using ObjectAda
V7.0 under Windows NT 3.51.

My novice question is:  Is it possible to query a running system to determine
what Ada tasks are available on the system, what their current execution state
is, and what public methods each has?  Something akin to the TAS or ATL command
on RSX (I know I'm dating my skills here) or maybe the VMS SHOW SYSTEM command.
I've quickly reviewed the Rationale document and the ARM, but it is not
obvious if this is possible or how one might approach the problem.  There was a
reference to a Task Control Block, but it wasn't clear to me if that is a user
defined data structure or part of some "run time" component of Ada.

I'd like to write a Windows/Ada task that could be executed and then used to
"browse" a system to see what tasks are there.  Then I would like to be able to
"manually" issue commands (send messages, invoke methods, whatever the correct
OO terminology is!) to these tasks much as another task would do in a "real"
multitasking environment.  

Any suggestions or document references will be appreciated and no I'm not a
student!  Well, I'm a student in that I'm learning something new, but I'm not a
"formal" student trying to get help with a class assignment.

TIA,
Matt

-------------------------------------------------------------------------------
Matthew S. Whiting, P.E.         | Corning Incorporated | (607) 974-6317 phone
Manager Advanced Control Systems | HP-ME-01-034         | (607) 974-6752 fax
whiting_ms@corning.com           | Corning, NY 14831    |





^ permalink raw reply	[flat|nested] 20+ messages in thread
* Ada tasking question
@ 2007-04-18 18:13 Stefan Bellon
  2007-04-18 18:40 ` Randy Brukardt
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Stefan Bellon @ 2007-04-18 18:13 UTC (permalink / raw)


Hi all!

Although I am quite familiar with Ada, tasking is quite new to me, so
please bear with me with my question. ;-)

I have a set of buckets where I do have to do some processing on them.
This processing can be done in parallel for each bucket. The results
of the processing however are accumulated into another data structure.

At present I have task types for the processing of the buckets, an
access type to the task type and basically just do:

   declare
      type Task_Access is access all Task_Type;
      My_Task : Task_Access;
   begin
      for I in Buckets'Range loop
         My_Task := new Task_Type'(Buckets (I));
      end loop;
   end;

The result data structure is a protected object with an entry Add that
adds the processing result to the container and which is called by the
task body.

All is well so far.

However the number of buckets may be quite large and I have the feeling
that the context switching which is needed for say 1000 or more tasks
eats up the gain of the parallelism. At least in my test cases I do not
gain anything at all on a Core Duo system.

Therefore I have the idea of just starting N tasks in parallel (where N
can be specified by the user e.g. according to the number of CPU cores
of the machine) instead of tasks for all buckets at once.

Starting N tasks, then waiting for them to get all finished and only
then starting the next N tasks is not difficult. But how would I do it,
so that there are always N tasks running (apart of course when
everything has been processed) and that a new tasks is starting on the
next bucket as soon as a task on a previous bucket has finished?

Any ideas are very welcome!

-- 
Stefan Bellon



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

end of thread, other threads:[~2007-04-20  4:32 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-10-18  0:00 Ada tasking question whiting_ms@corning.com (Matt Whiting)
  -- strict thread matches above, loose matches on Subject: below --
2007-04-18 18:13 Stefan Bellon
2007-04-18 18:40 ` Randy Brukardt
2007-04-18 20:12   ` Jeffrey R. Carter
2007-04-18 22:43     ` Stefan Bellon
2007-04-19  2:02       ` Steve
2007-04-18 21:08   ` Leif Holmgren
2007-04-18 22:57     ` Stefan Bellon
2007-04-18 23:41       ` Brian May
2007-04-19  0:25       ` Randy Brukardt
2007-04-19  8:02         ` Stefan Bellon
2007-04-19 12:47         ` Jacob Sparre Andersen
2007-04-19 16:11           ` Anh Vo
2007-04-20  4:32           ` Jeffrey R. Carter
2007-04-19  0:50       ` Jeffrey R. Carter
2007-04-18 19:50 ` Alex R. Mosteo
2007-04-18 23:00   ` Stefan Bellon
2007-04-19 20:37   ` Pascal Obry
2007-04-19  2:13 ` jimmaureenrogers
2007-04-19  7:49 ` Dmitry A. Kazakov

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