[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multitasking in MCL



At 12:21 PM 9/15/94 +0000, RIVEROLA, Josep wrote:
>How do you do multitasking inside MCL?. By this I mean having several tasks,
>written in MCL, that are scheduled by another task, written in MCL too. I am
>writing a simulation in MCL and I need this for process control. Thanks.

Doing it in general in MCL 2.0.x will be difficult if not impossible.
Our internal MCL 3.0dx has multi-tasking similar to the old style
Symbolics processes, and it mostly works (we demoed it at WWDC in 1993),
but I don't know when MCL 3.0 will see the light of day.

You can fake it if you split up each of your tasks into small
pieces, each of which is implemented by a single function. Then a
scheduler can schedule tasks to run a piece at a time.
This requires each task to explicitly store its state, however,
something that is done by having a separate stack for each task in
a real multi-tasking system. It also requires you to decide on task
granularity up front instead of letting the scheduler do it, like
cooperative multi-processing on the Mac, only more painful.