[plt-scheme] Using Scheme_Object * from another thread
On May 25, 2005, at 9:22 AM, Hans Oesterholt-Dijkema wrote:
> Will this cause problems with mzscheme? (e.g. because schheme_malloc()/
> scheme_make_utf8_string() is not OS thread safe).
You will see intermittent failures in the 3m variants. I don't know the
non-3m code nearly as well, but I suspect you will see failures there,
as well.
In order to do this safely, you'd need to (a) completely block the
Scheme
thread from allocating while your OS thread was running, (b) (most
likely)
force a garbage collection immediately on starting the OS thread and
(c) make
sure your OS thread isn't allocating enough memory such that it'll
trigger a
collection after the collection in (b). I would suspect that enforcing
these
would cost notably more than the savings you'll get from multithreading.
-Adam