[MLton] Multicore CPU's and MLton

Daniel C. Wang danwang@CS.Princeton.EDU
Sat, 02 Jul 2005 21:32:52 -0700


Stephen Weeks wrote:
{stuff deleted}

>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.
>  
>
I've forgotten how timer interrupts inter act with OS level threads. 
However, maybe a simple hack is to just allocate some fixed number of OS 
threads that each multiplex MLton's current lightweight threads. I guess 
there needs to be some global locking and way for the GC to "work".

Oh, once I get my box.. I'll be looking for an excuse to play with the 
dual cores.. I was hoping to find an MLton related project.I guess, I 
should look at the web-server someone recently ported to MLton that 
looks like something an extra core would be good for. :)