[MLton] Multicore CPU's and MLton

Wesley W. Terpstra wesley@terpstra.ca
Mon, 4 Jul 2005 12:16:31 +0200


On Sat, Jul 02, 2005 at 09:20:59PM -0700, Stephen Weeks wrote:
> > Does the current MLTon thread library take advantage of real
> > threading?
> 
> For the C codegen hack I'd use processes, so it wouldn't matter.  But
> to answer your question, MLton implements its own threads using a
> timer signal.  Threads don't run concurrently.  It would be nice to
> see some time spent on solving that and possibly adding some source
> language construct to make use of it.  But I imagine that's a lot of
> work.

Please don't do that... I am using MLton for an event driven state machine
similar to state-threads.sf.net. If you make threads really concurrent, that
would throw away the performance gain of this approach.

If real threading is added, I would like it to be a separate API from the
current continuation-based system. I am pretty sure that's what people would
have done anyway, but just what to emphasize that the current approach is
preferrable in a few situations (specifically scaleable servers).

-- 
Wesley W. Terpstra