[plt-scheme] Using Scheme_Object * from another thread

From: Adam Wick (awick at cs.utah.edu)
Date: Wed May 25 15:37:24 EDT 2005

No, I'm not sure.

For one thing, I'm not that familiar with the base collector, and for
another, I believe the one we use is at least slightly hacked. I'm not
entirely sure what the invariants are. You're going to have to wait
for Matthew's $0.02 on that one.


-Adam

Hans Oesterholt-Dijkema wrote:

>
> I thought Hans Boehms GC was thread safe. Are you sure?
>
> Hans
>
>
>
> Adam Wick schreef:
>
>>
>> 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
>>



Posted on the users mailing list.