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

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.



I gather that your current inclination is to preserve the requirement
that GC may only take place during calls to specially marked API
functions.  Thus, collection must wait until all active C calls have
called a marked API function.  Is that correct?

If the system is mostly a Scheme world, which makes occasional calls
to C helper functions, then this is not a very serious restriction.
Threads will usually be executing Scheme code, or spending short
periods in C code that makes frequent calls to SRFI-50 functions (or
could be written to do so), so it's not hard to keep the waits short.

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.

Similarly, for existing multi-threaded C programs that have C plug-in
interfaces, I would like to be able to implement plug-ins in Scheme,
and handle the Scheme / plug-in glue using SRFI-50.

In both of those cases, I have control over only a small portion of
the C code; threads will often spend the majority of their time in C
code I didn't write, which never calls SRFI-50 API functions.  So when
a thread wants to perform a collection, I don't have enough control
over the situation to ensure that all other threads will eventually
reach a SRFI-50 function.

So it seems to me that the requirement that all C calls must be in
marked SRFI-50 functions seriously restricts SRFI-50's usefulness in
these scenarios.  It's my impression that most developers would
consider it "not useful".  (I admit that's just an impression.)

The specific applications I have in mind that I'd like to extend in
Scheme are Mozilla and Apache.  Last I knew, Apache uses worker
threads on some systems, and distinct worker processes on others.
Mozilla is always multi-threaded.

I recognize that this is really a question about the scope of SRFI-50,
and I certainly respect the editors' right to set that scope.  But
really, any question about the presence or absence of a feature is a
question of scope --- for example, if I understand Marc Feeley's post,
his FFI doesn't permit access to Scheme objects at all.  So while I
think some posters have been a bit pushy, I still feel it's central to
the discussion where the boundaries should rest.