comp.lang.ada
 help / color / mirror / Atom feed
From: Richard Riehle <laoXhai@ix.netcom.com>
Subject: Re: Ada 95 tasking problems with Ada 83 code
Date: Tue, 05 Sep 2000 10:12:43 -0700
Date: 2000-09-05T17:25:04+00:00	[thread overview]
Message-ID: <39B5298A.177B7C15@ix.netcom.com> (raw)
In-Reply-To: 39B046AE.A05C82AA@mtws.visicom.com



Wayne Lydecker wrote:

>
> The original developers of our software were task and generic happy (some
> generics are up to three levels deep).  There is no valid reason that it has
> 100 tasks and I'd like to strip it down to a half dozen or so.

Wayne,

Be careful about this kind of decision.   All too often a designer intuits that less
tasks will be more efficient that more.   In fact,  the ideal for a task-based design
on a single processor, is that every task will always be immediately available to
do its work.   This ideal is frequently unachievable, but one can strive for it.

A corollary of the above statement is that most tasks will spend most of their
life waiting for something to do.   Once that something is actually done,  they
will suspend until asked to do it again.   This means that each task should do the
absolute minimum amount of work.   In particular, keep each rendezvous sparse
to prevent blocking other important actions.

It is not unusual, in fine-tuning a task-based design, to increase the number of tasks,
making each one leaner, instead of reducing the number of tasks.

Of course, it is still essential to do the mathematics on this before making such a
decision.
You must consider context-switching time,  priorities, and a whole host of other related

issues before simply changing the number of tasks in the design.  Also, with Ada 95,
many chores previously handed off to an active task can be more efficiently executed
through a protected type.   If you have not looked at protected types, this would be a
good time to do so.  For a good example of a simple protected variable, see Norman
Cohen's book, Ada As A Second Language,  17.4.4., page 831, from McGraw-Hill,
or, even better, get a copy of Concurrency in Ada, by Alan Burns and Andy Wellings.

Hope this helps,

Richard Riehle





  parent reply	other threads:[~2000-09-05 17:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-30  0:00 Ada 95 tasking problems with Ada 83 code Wayne Lydecker
2000-08-30  0:00 ` Richard Riehle
2000-08-30  0:00   ` Wayne Lydecker
2000-08-31  0:00     ` Jeff Creem
2000-08-31 20:07     ` Robert Barron
2000-09-01  3:21   ` Wayne Lydecker
2000-09-01  4:17     ` Richard Riehle
2000-09-02 22:54       ` Pat Rogers
2000-09-05 17:31         ` Richard Riehle
2000-09-05 18:51           ` Pat Rogers
2000-09-05 19:00             ` Richard Riehle
2000-09-05 19:33               ` Pat Rogers
     [not found]       ` <39B046AE.A05C82AA@mtws.visicom.com>
2000-09-02  1:04         ` Jeff Creem
2000-09-05 19:11           ` Richard Riehle
2000-09-05 17:12         ` Richard Riehle [this message]
2000-09-06  0:19           ` Ted Dennison
2000-09-06  2:38           ` Wayne Lydecker
2000-09-07  5:35             ` Simon Wright
2000-09-01 20:01     ` Robert A Duff
2000-08-31 16:00 ` Bill Dale
2000-08-31 17:57   ` Richard Riehle
replies disabled

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