www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/03/16/12:40:44

From: Michael Feldman <mfeldman AT seas DOT gwu DOT edu>
Subject: Re: Ada and djgpp
To: UCKO AT VAX1 DOT ROCKHURST DOT EDU (Aaron Ucko)
Date: Thu, 16 Mar 1995 09:21:00 -0500 (EST)
Cc: elston AT cave DOT arc DOT nasa DOT gov, djgpp AT sun DOT soe DOT clarkson DOT edu

> 
> >I am very excited about GNAT and the (upcoming) validation testing.  I
> >am sorry to hear that (as I read in the documentation) the DOS version
> >does not support tasking.  I hope that is rectified soon.  Dos will be
> >my primary Ada platform for a while.
> 
> You must be one heck of an optimist.  DOS was designed from the ground up
> to be unitasking (monotasking?), and making it anything else is nontrivial.
> 
That's a real oversimplification. Let me try to explain; kill this note if
a digression into tasking and language issues would bore you.:-)

While it is true that DOS itself is not multitasking, it is quite possible 
to build a multitasking system on top of DOS. Indeed, for the last eight 
years or so, Ada compilers for DOS - fully validated, from roughly 4 different 
suppliers - have been able to do Ada-level tasking and many quite successful
applications have been fielded, in and out of the government. 

Ada 83 tasking functionality includes things like:

- nondeterministic selection (guarded commands, critical regions)
- multiple priorities
- access to hardware interrupts
- timers
- time-slicing

in short, just about everything one could wish. The catch is that all of
this operates under control of the Ada runtime, and essentially under a
single Ada main program. The interesting thing, though, is that tasking
programs can be - and often are - written to be quite portable. It
depends on how much you are willing to isolate yourself from the OS.

Where DOS falls down, it is true, is in the ability to kick off completely
independent programs as processes, and have the OS take care of preemptive
scheduling. The net result is that a multitask Ada program is sort of
isolated from other DOS programs. But for those developers who have
no problem essentially giving the machine over to a runtime on top of
DOS, this has not presented a problem.

Having taught all of this for ten years or so, to all sorts of student
and practitioner types, I've learned that each of us seemingly has
his or her own notion of what "multitasking" is. To some, if the OS
cannot do it, it cannot be done. Probably they haven't really focused
on the possibiities of doing it _in the language_, with tasking
constructs that are independent of the underlying OS.

Naturally there are tradeoffs here, in functionality (all of my Ada tasks
are ususually seen as collected into a _single_ OS-level process), and
- sometimes - in performance (we can't always use all the OS goodies).
On the other hand, "fast enough is fast enough."

(For anyone wishing to explore Ada 83 tasking on DOS, I can point you to a
free system with some very interesting demos and runtime monitoring.
I'll post an announcement of this in a separate note; since it's off
the subject of this group, I'll mark it clearly so you can kill it if you
are not interested.)

OK, so why is there no GNAT tasking on DOS? Precisely because the GNAT
project is committed to using as much of the underlying OS as is possible.
We now believe it possible to support Ada tasking using one of the threads
packages out there; indeed some of the djgpp V2 folks are exploring 
similar approaches and we are likely to be working together.

Sorry for the digression -

Cheers -

Mike Feldman

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019