Re^2: What kinds of things would you want in the GNU OS?
Craig Presson
craig at wave4.webo.dg.com
Wed Jun 7 23:29:41 AEST 1989
In article <8591 at chinet.chi.il.us> les at chinet.chi.il.us (Leslie Mikesell) writes:
>In article <10336 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>
>>The supposed advantage of a thread is that it's cheap to create one,
>>even compared with setting up copy-on-write for a fast fork(). The
>>obvious disadvantage is that the shared data space requires use of
>>concurrency controls among the parallel threads (e.g. monitors).
>
>That's what I thought, but I can't see where it would be useful, except
>perhaps to make up for certain OS functions that might be lacking
>like the ability to cheaply determine that no I/O is pending on any
>of several channels so you can continue doing some work without needing
>a new thread. Wouldn't there be a problem with static data in
>library routines (or anywhere else)?
>
>Les Mikesell
>
You betcha, Les. You definitely have to do something to protect any
static data which may change. In the DG OSes since 1972 or thereabouts,
(RDOS, the AOS family, and the MP/whatevers), there has been a fairly
well-understood mechanism for multithreading a single user program in
a single address space, with user control of task (==thread) creation,
intertask communication, priority, etc. It has been used for many things
over the years, a lot of them real-time flavored, but some not, like
overlapping disk I/O - processing - tape I/O in backup utilities, timers
and alarms in a variety of programs, etc. During that whole evolution,
the #1 easy trap for programmers to fall into was to unknowingly depend on
the value of some unprotected static data, which then changes or becomes
inconsistent. That's why the MACH project, for example, chose to provide
a "C Threads" library with support for well-managed shared variables.
At DG, we just made a religion of re-entrancy, and were helped along
greatly by the sophistication of many application builders. In the
meantime, the state of the art has progressed to the point where the
problem is not to find a mechanism for solving concurrency problems,
but to choose among a profusion of them.
Those who are saddled with language or OS implementations that neglected
to provide for concurrency have my sympathy. I doubt that a smooth way out
is possible; they'll have to hold their breath and upgrade to a modern
OS ...
--
"Why am I a look alike a poss of porterpease?"
-- James Joyce, _Finnegan's Wake_
uunet!wave4.webo.dg.com!craig UUCP \
craig at wave4.webo.dg.com CSNET-to-dg/ux-node ->the 3 faces of DG
craig_presson%DGC.ceo.dg.com at relay.cs.net /
CSNET-to-AOS/VS
Craig Presson, Data General, Westborough Mass. dg/ux development
More information about the Comp.unix.wizards
mailing list