[MLton] cvs commit: critical sections during thread switch

Matthew Fluet fluet@cs.cornell.edu
Sun, 4 Apr 2004 09:00:24 -0400 (EDT)


> I notice with this checkin that GC_switchToThread was changed to use
> the slow implementation of thread switching.

Yeah, I just wanted to fall back on something that was obviously correct
before trying to optimize.

> Would it be possible to add the same logic to the fast (FALSE) branch
> and use that?

Probably.

> The hope is that thread switching should be just a few instructions
> (10 or so) so that we could imagine implementing it in the backend
> someday without a C call.  In fact, maybe this is a good time to
> consider doing that, since it would address the problem that atomicEnd
> is implemented in two different places.

I'll look into that as well.  But, I'll try to fix up the fast branch
first.