[MLton] Multicore CPU's and MLton

Stephen Weeks MLton@mlton.org
Sat, 2 Jul 2005 21:44:02 -0700


> I've forgotten how timer interrupts inter act with OS level threads.

My point is that as far as the OS is concerned, MLton executables are
single threaded.

> 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".

Yes, the current allocation and GC approach would be very painful
(performance wise).  You really want each thread to have its own local
heap so that it can allocate quickly there without a lock.  This would
require some restructuring of the GC code (I may be putting it too
mildly).