comp.lang.ada
 help / color / mirror / Atom feed
From: mcsun!corton!chorus!nocturne.chorus.fr!jloup@uunet.uu.net  (Jean-Loup Gai
Subject: Re: Ada and Unix--Blocked Tasks
Date: 6 Aug 91 14:17:03 GMT	[thread overview]
Message-ID: <11561@chorus.fr> (raw)

Mike Feldman writes in answer to messages by Paul Stachour and Howard
Turner:

| What Paul might be getting at is the notion that an Ada compiler could
| (should) map each Ada task onto an OS-level process. I see no reason in
| principle why this could not be done; indeed, I think there may be vendors
| who are doing it in Unix (can anyone confirm this?). I believe I heard
| that one of the MVS (IBM mainframe) Ada systems can map Ada tasks to MVS
| tasks (can anyone confirm?). In practice, I imagine that vendors are
| keeping an ada program - tasks and all - in one OS-level process for
| efficiency, reasoning that mapping tasks onto processes is overkill.
| 
| This is an area where I'd love to see some material that would let us in
| on some of the "inside" discussions that must have taken place over the
| years. Norm Cohen? Tucker Taft? Bob Eachus? How did the designers 
| imagine the (possible) relationship(s) between tasks and processes?

I was one of the designers of several Alsys Ada compilers. The main
reason we chose to map all tasks in a single Unix process is that Ada
requires all tasks to share memory (unless you put severe restrictions
on the program structure). At the time of the design, it was not
possible to share memory between different Unix processes. On systems
which do allow sharing of memory between OS-level tasks (MVS, LynxOS, VRTX)
the Alsys compilers support a one-to-one mapping between Ada tasks and
OS-level tasks. The MVS compiler even supports a more general M-to-N
model were there can be several Ada tasks per OS-level task and
several OS-tasks per Ada program. The main motivation for this general
model is that tasks switches performed by the Ada runtime without
OS intervention are far more efficient than those requiring system
calls. The user can then tune the program by chosing the best
mapping between Ada tasks and OS tasks. The mapping can be performed
at bind time and does not require recompilation.

There is a little cost for this generality: the M-to-N model is more
complex than the one-to-one model. However the runtime overhead is quite
small and even negligible on systems such as VMS where any system call
costs several thousands instructions.

In the all-to-one model used for Unix, the Ada runtime avoids blocking the
whole process when one Ada tasks makes a blocking IO call, but only
when the predefined IO packages are used. As mentionned by Howard Turner,
the Ada runtime has no control on arbitrary blocking system calls.

To answer your specific comment: there are applications where mapping
Ada tasks onto OS tasks is not overkill but necessary to avoid
blocking the entire Ada program. The M-to-N model lets the user pay
the associated cost only when strictly necessary. On real time systems
such as Chorus where a switch between OS tasks is very efficient, the
simpler one-to-one model is also a sensible solution.

Jean-loup Gailly

Chorus systemes, 6 av G. Eiffel, 78182 St-Quentin-en-Yvelines-Cedex, France
email: jloup@chorus.fr    Tel: +33 (1) 30 64 82 79 Fax: +33 (1) 30 57 00 66

             reply	other threads:[~1991-08-06 14:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-08-06 14:17 mcsun!corton!chorus!nocturne.chorus.fr!jloup [this message]
  -- strict thread matches above, loose matches on Subject: below --
1991-08-16 15:43 Ada and Unix--Blocked Tasks bu.edu!inmet!offer
1991-08-14 15:24 torolab4.vnet.ibm.com!jrussell
1991-08-10  4:59 Robert I. Eachus
1991-08-07  1:35 Bob Kitzberger @midnight
1991-08-06 20:12 mcsun!corton!chorus!nocturne.chorus.fr!jloup
1991-08-06 18:48 Mike Murphy
1991-08-06 17:23 David Emery
1991-08-06 14:57 Drew Johnson
1991-08-06 14:32 Dan L. Pierson
1991-08-06 12:32 Arthur Evans
1991-08-06  9:17 Jim Showalter
1991-08-06  4:05 Mike Feldman
1991-08-05 19:56 Howard E. Turner, Jr.
1991-08-05 19:04 EDWARD CRAGG
1991-08-05 16:06 David Emery
1991-08-05 15:25 Fred Stluka
1991-08-05 14:14 Paul Stachour
1991-08-05  5:08 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!news.cs.indiana.e
1991-08-02 18:17 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!cs.u
1991-08-02 13:28 Dennis Doubleday
1991-07-30 19:35 Dave Lewicki
replies disabled

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