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

Re: Threads



James McCartney <asynth@io.com> writes:

> On Saturday, May 11, 2002, at 10:30  AM, Jonathan Bachrach wrote:
> 
> > i think the general thought is to not support native threads but
> > to instead support threads built out of upward continuations
> > (i.e., cooperative threads).
> 
> This is what I have done in SuperCollider, however the problem with
> it is that if you make a blocking system call in a primitive you've
> stalled all of the threads. There are solutions but every one I've
> thought of is an inelegant hack and too much work for something that
> should be simple.

i agree.  last summer i asked richard kelsey about how they did it in
scheme48.  he didn't seem to be that put off by the amount of work,
but i don't seem to recall him boasting about a clever and simple
solution.  i'll talk to him to find out exactly what they did.

another approach is purely cooperative, counting on users to avoid
getting blocked by using select in front of their potentially blocking
io calls.

jonathan

> --- james mccartney   james@audiosynth.com   <http://www.audiosynth.com>
> SuperCollider - a real time synthesis programming language for the
> PowerMac.
> <ftp://www.audiosynth.com/pub/updates/SC2.2.14.sea.hqx>