comp.lang.ada
 help / color / mirror / Atom feed
From: barmar@think.COM (Barry Margolin)
Subject: Re: INFO-ADA Digest V88 #47
Date: 10 Mar 88 01:29:32 GMT	[thread overview]
Message-ID: <17701@think.UUCP> (raw)
In-Reply-To: 415@zap.UUCP

In article <415@zap.UUCP> fortin@zap.UUCP (0000-Denis Fortin) writes:
>Well, I agree that non-preemptive prioritized task scheduling makes
>sense for some applications.  But in order for it to work, a task has to
>be able to explicitly return the control to the "scheduler" when it has
>expended its time slice. 

In a non-preemptive environment, there wouldn't be any notion of "time
slice".  A task returns control to the scheduler any time it executes
a DELAY, ACCEPT, SELECT, or INITIATE statement, or when it calls a
task entry.

In this case, the purpose of task priorities is not to cause
low-priority tasks to be suspended immediately, but to guide the
choice of a new task to run when a task intentionally gives up the
processor.

If the tasks do a good deal of asynchronous I/O, they will give up the
processor frequently while waiting for input or for an output buffer
to empty.  So you can get something that approximates preemptive
scheduling.  On Multics, we have software that implements
non-preemptive prioritized multitasking in a process, using precisely
this scheme, being used for network servers, so that one process can
handle all incoming mail simultaneously; when one task goes blocked
waiting for the text of a message another task can deliver its
message.  There's a controller task with high priority that waits for
commands from the system operator; if a command is sent, it will
always run as soon as one of the server tasks goes blocked for network
input.

(As an aside, it is theoretically possible to do pre-emptive
scheduling with the above software, by using timer-driven process
interrupts (similar to Unix signals), and having the timer interrupt
handler invoke the multi-tasking scheduler, but I don't think anyone
has actually tried this.)

Barry Margolin
Thinking Machines Corp.

barmar@think.com
uunet!think!barmar

  reply	other threads:[~1988-03-10  1:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1988-02-20 19:55 INFO-ADA Digest V88 #47 PETCHER%SVDSD
1988-03-01  2:25 ` Barnacle Wes
1988-03-07 15:48 ` Denis Fortin
1988-03-10  1:29   ` Barry Margolin [this message]
1988-03-10 13:28     ` Terry Westley
1988-03-10 17:13       ` Barry Margolin
replies disabled

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