Should GC hooks be used to help broken software?
Svante v. Erichsen
Svante.v.Erichsen at web.de
Sat Jul 4 12:35:46 UTC 2015
Hi!
On 2015-07-04 19:30:01+0800, Elias Mårtenson wrote:
> My question is: Should I use trivial-garbage to create a GC hook for the
> connection object so that if the user of the library forgets to close the
> connection, it will get closed eventually once it's GC'ed?
My first impulse is to say “that is what garbage collection is there for”. It
needs not matter whether the object resides in C or Lisp land or what kind of
resource it is; if the system can identify that it is garbage, it should collect
it.
The alternative would also mean that it is difficult for the system to recover
from the mistake without restart.
Additionally, the API might benefit from a with-async-connection and a
with-open-channel macro.
Yours aye
Svante
--
Svante von Erichsen
GPG fingerprint: A78A D4FB 762F A922 A495 57E8 2649 9081 6E61 20DE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://mailman.common-lisp.net/pipermail/pro/attachments/20150704/a9d8d7b1/attachment.sig>
More information about the pro
mailing list