guile-user
[Top][All Lists]
Advanced

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

Re: Is my procedure getting GCed?


From: Marius Vollmer
Subject: Re: Is my procedure getting GCed?
Date: 15 May 2001 01:30:16 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102

Dirk Herrmann <address@hidden> writes:

> I don't know about how this works with shared libraries, though:
> What happens if you unlink a shared lib, but still have pointers
> into global variables belonging to that lib?

Nuclear warheads will begin their long march towards the east and in
response, China will divert the river Hwangho to India (you don't need
to guess why it is called the Yellow River), which will cut the rest
of the world off from their IT personnel supply for decades to come.
Hordes of C and Unix people will gather in all major cities and
proclaim: "We don't need no stinking automatic garbage collection!  We
like garbage!  All our products are garbage!"


Err, well, it wont work.  But we already have the same situation with
primitive functions supplied from shared libraries.  I think we can
solve this problem, but its low on my list.

If anyone is interested, here are some thoughts: make a new
abstraction called a "extension".  A extension manages a shared
library (or not) and Guile manages extensions via its normal GC.  When
the last reference to a extension is dropped, the contained shared
library will get unlinked (or not, depending on its own reference
count).  All features of Guile that store pointers to C entities keep
a pointer to the corresponding extension.

That would be quite a lot of code and book keeping I'm afraid.  Plus,
once we have a smob type or port type that refers to a particular
extension, that extension wont get collected at all since smob types
and port types don't disappear.  So maybe in the end, we could get by
with just disallowing to unlink extensions categorically.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]