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

Re: select/3 call equivalent in mzscheme



Quoting Matthias Felleisen:
> Are these micro-threads more or less continuations? In Scheme you can
> pretty much implement all of these things assuming you have a timer 
> interrupt from call/cc plus interrupt handler setting. 

Yes, from what I could tell by browsing information on the web. And
it's how MzScheme threads work, of course. In other words, it looks
like MzScheme's threads are essentially "microthreads".

There's no problem with creating thousands of threads in MzScheme,
though 1000 threads in the current implementation would occupy around
25MB. I think this can be reduced to around 5MB easily, with a little
tuning. More after I've had time to run some experiments...

Certainly threads can be much smaller than the 5k/thread that I'm
suggesting. My uninformed guess is that Python's microthreads are
probably 10 times smaller, since they've likely focused on size --- but
that's really a guess.

In any case, I don't see smaller threads as a likely near-term
direction for us, due to MzScheme's architecture.

Matthew