local refs
Stephen Weeks
MLton@sourcelight.com
Fri, 7 Dec 2001 11:41:44 -0800
> Right; invokeRuntime's don't return arguments, because the invocation
> might switch threads, and we don't have anywhere to stash the return
> result until we get back to the thread that wanted it. So, we store the
> return result in globals and fetch them with ffi's. This, in turn, only
> works out in this case because we ensure that no other thread trashes the
> stored values by using atomicBegin/End. So, maybe a better
> correspondence is:
Actually, GC_copyThread and GC_copyCurrentThread do not allow thread
switches to happen. But, since any limit check does, the critical
sections are still necessary.