[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: when GC is permitted

This page is part of the web mail archives of SRFI 50 from before July 7th, 2015. The new archives for SRFI 50 contain all messages, not just those from before July 7th, 2015.



Am 07 Jan 2004 20:43:05 -0500 hat Jim Blandy <jimb@xxxxxxxxxx> geschrieben:


Tom Lord <lord@xxxxxxx> 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