Re: when GC is permitted Felix Winkelmann 08 Jan 2004 07:33 UTC

Am 07 Jan 2004 20:43:05 -0500 hat Jim Blandy <xxxxxx@redhat.com> geschrieben:

>
> Tom Lord <xxxxxx@emf.net> writes:
>>     >    However, I would like to be able to use Scheme as an extension
>>     >    language for existing C programs that use multiple system
>> threads, and
>>     >    I would like SRFI-50 to provide what I need to implement the
>> C/Scheme
>>     >    glue for this.
>>
>>     > To be useful in such a situation there would need to be a way to
>> exit
>>     > and then re-enter the implicit critical section surrounding C
>> calls.
>>
>> What are you talking about?  I can imagine many interpretations of
>> what you're saying but none that make your statement both true and
>> significant.
>
> What he wrote seems clear enough.  If SRFI-50 provided a begin/end
> pair of functions that indicated that the calling thread was holding
> no references to heap objects, then collection wouldn't need to wait
> for threads in that state.  One could call the 'begin' function when
> beginning use of SRFI-50 functions, and the 'end' function when
> leaving the module.
>

I don't understand this. If the C code does not hold direct references
to the data (i.e. if you add an extra indirection), and if you access
the data only over a designated interface, GC can certainly run
whenever it wants, even during the execution of the C code. That's
the whole point of the abstraction exercise.

cheers,
felix