Allowing GC in Allegro CL SMP during foreign function calls

Stelian Ionescu sionescu at cddr.org
Wed Jul 31 09:15:03 UTC 2013


On Wed, 2013-07-31 at 09:55 +0100, Luís Oliveira wrote:
> On Tue, Jul 30, 2013 at 4:33 PM, Felix Filozov <ffilozov at gmail.com> wrote:
> > When defining a foreign function using def-foreign-call, there's an option
> > one could set called :allow-gc. Setting it to :always, allows the garbage
> > collector to run while the foreign function is executing.
> >
> > At the moment CFFI uses the default value for :allow-gc, which is :never.
> > This prevents GC from running when a foreign function is executing.
> >
> > Moreover, once GC blocks, other processes can't make progress. In my case, I
> > need GC to run during foreign function execution.
> 
> I understand the advantages of overriding ACL's default. What are the drawbacks?
> 
> Also, what do other Lisps do? We probably want to be as consistent as
> possible across the platforms we support.

SBCL never disables GC globally, and I don't think that CCL, ECL or ABCL
do that either.
http://www.lispworks.com/documentation/lw61/FLI/html/fli-94.htm#pgfId-1070272 has no mention of GC, so it would seem that among SMP Lisps Allegro is the only one to do sophisticated stuff. CMUCL and Clisp are currently single-threaded so GC is implicitly disabled during foreign calls.

-- 
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.
http://common-lisp.net/project/iolib

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20130731/9c6238ef/attachment.sig>


More information about the cffi-devel mailing list