comp.lang.ada
 help / color / mirror / Atom feed
From: Samuel Tardieu <sam@inf.enst.fr>
To: cosc19z5@Bayou.UH.EDU (Spasmo)
Subject: Re: Concurrency in Gnat 3.05?
Date: 1996/07/18
Date: 1996-07-18T00:00:00+00:00	[thread overview]
Message-ID: <qw63f2qou73.fsf@gargantua.enst.fr> (raw)
In-Reply-To: 4sjqte$3mu@masala.cc.uh.edu


>>>>> "Spasmo" == Spasmo  <cosc19z5@Bayou.UH.EDU> writes:

Spasmo> Is there any place where I can find some detailed GNAT
Spasmo> specific docs? I know my questions are simple newbie ones that
Spasmo> could be answered given some detailed GNAT docs, however all
Spasmo> the docs I have seem to be about installation, or DJGPP, so I
Spasmo> end up wasting bandwidth asking newbie questions because I
Spasmo> can't seem to find the answers anywhere.

In the GNAT distribution, there should be a file called
gnatinfo.txt. In this file, you should find everything you want and
even much more :-)

Spasmo> Is Gnat 3.05 (for DOS) truly concurrent when executing tasks?

AFAIK it's not, but there is nothing in the RM that requires it !

Spasmo> I'm asking because I've written some tasking code (finally got
Spasmo> it to link) and when I ran the code, the tasks didn't run
Spasmo> concurrently at all.

Have you tried to use priorities ?

Spasmo> I'm running in a Win95 DOS box.  One task runs to completion
Spasmo> before the other task starts up.

That's common when you have a monoprocessor. If you need one of your
task to be more "reactive", you may increase its priority (assuming it
won't hog your whole CPU power).

Spasmo> I've also tried some sample code including Feldman's Twotasks
Spasmo> program and they exhibit the same behavior.  Is there a way to
Spasmo> get tasks to run concurrently, or would I have to look for a
Spasmo> GNAT that's native to something like WinNT/95 that can handle
Spasmo> multi-tasking?

Once again, multitasking doesn't imply time-sharing between
same-priority tasks. You may have true multitasking with no
time-sharing.

Anyway, as long as you have preemptive tasking, you may achieve what
you are trying to do by adding a task running at an higher priority
and waking up every <n> microseconds to give one of your two task a
priority highest than the second one. 

Example: let's assume you have two tasks T1 and T2, running at the
same priority level L. You want to do time-sharing between these two
tasks. You add a task S (scheduler) running at priority L+2, which
"delay"s for <n> microseconds then sets the priority of T1 to L+1 and
the one of T2 to L (and vice-versa each two times), and then delays
again, ... This way, your two tasks T1 and T2 run concurrently.

  Sam
-- 
"La cervelle des petits enfants, ca doit avoir comme un petit gout de noisette"
                                                       Charles Baudelaire




  parent reply	other threads:[~1996-07-18  0:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4sjqte$3mu@masala.cc.uh.edu>
1996-07-18  0:00 ` Concurrency in Gnat 3.05? Kevin J. Weise
1996-07-18  0:00 ` Robert Dewar
1996-07-19  0:00   ` Spasmo
1996-07-19  0:00     ` Tucker Taft
1996-07-18  0:00 ` Jerry van Dijk
1996-07-20  0:00   ` Robert Dewar
1996-07-20  0:00   ` Robert Dewar
1996-07-18  0:00 ` Samuel Tardieu [this message]
1996-07-20  0:00   ` Robert Dewar
1996-07-20  0:00     ` Michael Feldman
1996-07-18  0:00 ` Robert Dunn
1996-07-19  0:00   ` Jon S Anthony
1996-07-19  0:00     ` Robert Dewar
1996-07-20  0:00     ` Michael Feldman
1996-07-24  0:00     ` Jon S Anthony
1996-07-19  0:00   ` Spasmo
1996-07-18  0:00     ` Robert Dewar
1996-07-20  0:00       ` Michael Feldman
1996-07-22  0:00   ` Jon S Anthony
1996-07-22  0:00   ` Jon S Anthony
1996-07-24  0:00     ` Michael Feldman
1996-07-22  0:00   ` Jon S Anthony
1996-07-24  0:00   ` Jon S Anthony
1996-07-20  0:00 ` Michael Feldman
1996-07-20  0:00   ` Robert Dewar
1996-07-21  0:00   ` Jerry van Dijk
1996-07-24  0:00   ` Spasmo
replies disabled

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