[plt-scheme] Re: threads and mzscheme

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon May 23 16:23:17 EDT 2005

At Mon, 23 May 2005 17:40:34 +0100, John Kozak wrote:
> Matthew Flatt <mflatt at cs.utah.edu> writes:
> [...]
> > There's just one system thread, and MzScheme has its own scheduler
> > (hierarchical, round-robin) to swap Scheme continuations/threads.
> 
> Are there any prospects of something like an N:M threading model
> (i.e. multiple scheme threads per system thread as now, but more than
> one system thread),

Not in the near future.

Years ago, MzScheme did support OS-level threads to implement Scheme
threads. I use the term "support" loosely; it was never reliable, and
the locks were difficult to maintain, so we dropped support for
OS-level threads.

The problem is that there is a lot of state in the MzScheme run-time
system (module tables, ports, symbol tables, etc.), and we never
managed to insert enough locks. Even if we did manage to insert enough
locks, it seemed unlikely that we would be able to maintain them
correctly. Finally, there seemed to be little demand for OS-level
threads.

If we're ever to support multiple OS-level threads, someone will have
to figure out a better way to implement it than manually inserting
locks. So far, we haven't tried anything else.

Matthew



Posted on the users mailing list.