[MLton] More on Parallel Runtime

skaller skaller at users.sourceforge.net
Sat Oct 20 18:13:51 PDT 2007


On Sat, 2007-10-20 at 15:40 -0400, Philip Schatz wrote:
> Eric McCorkle wrote:

> I have tested this code with a few programs that spawn a simple 
> "executor" on multiple pthreads. Currently I'm trying to get CML working 
> using this model and have run into a little snag getting signal handling 
> to work (CML uses preemptive threads). Well-defined safe-points would be 
> an elegant way to overcome this.

But very inefficient, even if you can optimise placement of safe-points,
you will need one in every tight loop. This is probably not acceptable.

For example, consider a matrix multiplication. Are you going to safe
point every multiplication or only once per inner-product? The answer
is you cannot choose. It depends on the matrix size. You actually
want the safe points to be separated by a fixed time unit but
to be safe they're at fixed code positions and the correlation
is indeterminate in that it may depend in complex ways on
user input to the program (eg a matrix read from a file).

Have you seen how Boehm's collector does thread management?
It varies from platform to platform, and each implementation
has problems, but it is trying to work with arbitrary existing
C and C++ code, so a dedicated ML system should be easier.

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net



More information about the MLton mailing list