Newsgroups: comp.sys.transputer
From: andyr@wizzy.com (Andy Rabagliati)
Subject: Re: Help : Multi level priority scheduler
Organization: W.Z.I.
Date: Sat, 10 Dec 1994 23:29:00 GMT
Message-ID: <D0MBwC.1sr@wizzy.com>

Choe Tae-Young <choety@yoobee.postech.ac.kr> wrote:

>I'm programming in transputer using inmos ANSI C.

Well, I think you might have to dip down to assembler.

>I want to program process scheduler whose priority level is more than
>binary.

First suggestion :- Run higher priority stuff on another transputer.

Second suggestion:- Look for other operating systems that run on
transputers - try Parix, Express ???

But, if you *really* want to do this ....

You need the scheduler running at high priority, and everything else on
your own sorted low priority queues.

The low priority queue is just a linked list, that goes from front to
back.

When the scheduler is running, it will usually have interrupted a
low priority process, that will be sitting in the low priority save
area, just below MEMSTART. If you have done things right, it will have
interrupted a marker process that you put on the front of the queue.

At that time, you will investigate the low priority queue, looking for
processes that have been scheduled by timer or I/O operations, take them
off and put them in your own stash of priority queues. You will have to
know, probably from the WPTR, where these processes came from, and thus
which queue they belong on.

Having emptied the low priority queue, stuff the process you want run
next into the low priority save area, put a marker process on the front
of the low priority queue that will output a byte to your Hi priority
scheduler, waking you up for next time.

Cheers,     Andy!

% perl -lape '$usa && s/queue/list/g'

Disclaimer :- I have never done this.
Plug       :- I would if you paid me.

--
Andy Rabagliati . andyr@wizzy.com . P-P-Parallel Processing . +1.719.635.6099

