comp.lang.ada
 help / color / mirror / Atom feed
From: mfeldman@seas.gwu.edu (Michael Feldman)
Subject: Re: Tasks in Gnat3.05 for Dos?
Date: 1996/07/21
Date: 1996-07-21T00:00:00+00:00	[thread overview]
Message-ID: <4sun50$qdd@felix.seas.gwu.edu> (raw)
In-Reply-To: 4su2km$dt4@masala.cc.uh.edu


In article <4su2km$dt4@masala.cc.uh.edu>, Spasmo <cosc19z5@Bayou.UH.EDU> wrote:

>Timeslicing.  IN any case that's not to be as many folks have told
>me, and now that I've started working on some tasking code, I find
>that it's actually a good thing since it's better that I implement
>my own atomic slicing based on units of work via different entries.

Yes, I think you'll end up writing better concurrent programs that way.
They will be independent of the underlying RT and OS dispatching, 
and that sort of program is just one of the key things Ada's high-level
tasking constructs were designed for.

And writing that sort of platform-independent concurrent program
in C, say, is very difficult, nigh-on impossible, in the current state 
of threads implementations. 

At some point, POSIX threads may make this easier. In the meantime,
note that GNAT tasking is implemented over whatever threads library
is available, which means a bunch of system-independent stuff in the
runtime. Aren't you glad all that threads stuff is taken care
of by the GNAT runtime, instead of your having to write it yourself,
program by program?

  * * * * *

Allow me one anecdote. I recently finished teaching a course in which 
the semester project was to develop a software simulation for a part of
a rapid transit system such as the Washington area's Metrorail.
(Metrorail really does operate under automatic control, BTW.)

I set an overall goal of developing a nice object model for trains,
tracks, stations, control points, etc., and students were to exploit
the platform-independent tasking model to the greatest extent
possible.

One especially nice 2-person project used a character-based display,
and drew a rough map of the rail ines at the top, with little
scrolling windows at the bottom to give status reports on the
movements of the trains. This project was full of tasks and
protected types.

The students developed this on Solaris. After the course was over, I 
decided to download their code and use it as a shakedown of tasking on
DOS, which had just been completed. It compiled and ran the first time,
without changing a single character of source code!

Two weeks ago I got _really_ bold, and decided to try out the tasking
using the GNAT-MachTen for Mac. Tasking had just been (mostly) completed.
Yep, the Metrorail project compiled and ran the first time, again
without changing a single character of source code.

I was extremely pleased, though not terribly surprised, because over
the last ten years I've really come to appreciate the power of the Ada
"concurrent object" model, and how easy it is to write really
platform-independent concurrent programs. 

If anyone is interested, I just put a paper on the Metrorail project
on the Web at 

http://www.seas.gwu.edu/seas/eecs/Research/ada/metro/metro.html

Comments welcome.

Mike Feldman




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

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-16  0:00 Tasks in Gnat3.05 for Dos? Spasmo
1996-07-16  0:00 ` John S. Harbaugh
1996-07-17  0:00   ` Spasmo
1996-07-17  0:00     ` Robert Dewar
1996-07-21  0:00       ` Spasmo
1996-07-21  0:00         ` Michael Feldman [this message]
1996-07-22  0:00         ` John Harbaugh
1996-07-23  0:00           ` Robert A Duff
1996-07-24  0:00             ` John Harbaugh
1996-07-23  0:00       ` Jon S Anthony
replies disabled

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