comp.lang.ada
 help / color / mirror / Atom feed
From: Darren New <dnew@san.rr.com>
Subject: Re: Multitasking theory question
Date: Tue, 25 Jun 2002 04:19:44 GMT
Date: 2002-06-25T04:19:44+00:00	[thread overview]
Message-ID: <3D17EF7D.40F88B17@san.rr.com> (raw)
In-Reply-To: 5VRR8.145$7G4.15087@news.xtra.co.nz

AG wrote:
 
> Really? If I remember correctly, even the 3.something DOS could print
> while it waited for the key-press.

Depends on the system call, yes. There were definitely "read a key" calls
that didn't return until a key had been pressed. There were some that did.
The ones that did aren't the ones I'm talking about, naturally.

> > If the question is "where does the OS enter into it if I do all my
> > scheduling myself", the answer is "when you call the OS with one thread
> and
> > the OS prevents all the other threads from running."
> 
> OK, I'll have to agree with that - if you really have an OS that can prevent
> you
> from executing arbitrary code regardless of permissions/access rightts etc
> etc
> that you have - then "no can do" I guess - the thing is simply broken. In
> fact,
> it's just not functional.

Err, well, no. I think you're still missing the point. Say you're trying to
write (say) a web server. The only I/O the OS supports is blocking I/O.
There's no way to say "I have three sockets open, wait for whichever one is
readable first."  The only way to make this work is either rewrite the
blocking device drivers yourself, or have threads that don't run "properly".
There doesn't need to be a deadlock, but you don't want one dropped
connection to take 5 minutes to time out before you service the next visitor
either.

> Will a car-engine control program written under DOS on x86 machine qualify?

Dunno. Were you calling anyone else's code? Or did you write all the device
drivers yourself? Of course if you don't use any blocking calls in the OS
then you can write your own scheduler.

Is it me, or do many of these discussions degenerate into "well, in spite of
the fact that what you're trying to say is obvious, here's one possible way
to read your words such that you'd be mistaken in a small number of special
cases"? If there are OS services you rely on that might possibly take an
unacceptably long time to return to the control of the user program, no
amount of user-level coding in the run-time system is going to let you
schedule another thread to run during that time. That just seems obvious
(almost tautological) to me, but it's possible I'm mistaken. 

-- 
Darren New 
San Diego, CA, USA (PST). Cryptokeys on demand.
** http://home.san.rr.com/dnew/DNResume.html **
** http://images.fbrtech.com/dnew/ **

     My brain needs a "back" button so I can
         remember where I left my coffee mug.



  reply	other threads:[~2002-06-25  4:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-20 20:46 Multitasking theory question Kai Schuelke
2002-06-20 20:53 ` Stephen Leake
2002-06-21  2:13 ` Ted Dennison
2002-06-24  3:18   ` AG
2002-06-24  4:13     ` tmoran
2002-06-24  4:24       ` AG
2002-06-24  7:33         ` Dale Stanbrough
2002-06-25  3:27           ` AG
2002-06-25  4:48             ` tmoran
2002-06-25  5:00               ` AG
2002-06-25  5:17               ` Darren New
2002-06-25  5:25                 ` AG
2002-06-24  5:43     ` Mark Biggar
2002-06-24  6:48       ` AG
2002-06-24 15:14         ` Darren New
2002-06-24 16:19           ` Larry Kilgallen
2002-06-25  2:01           ` AG
2002-06-25  3:21             ` Darren New
2002-06-25  4:01               ` AG
2002-06-25  4:19                 ` Darren New [this message]
2002-06-25  4:51                   ` AG
2002-06-26  1:58                     ` Darren New
replies disabled

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