Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* [Caml-list] GC and code unloading
@ 2004-10-09  9:47 skaller
  0 siblings, 0 replies; only message in thread
From: skaller @ 2004-10-09  9:47 UTC (permalink / raw)
  To: caml-list

I'm seeking design ideas which enable safe unloading
of dynamically loaded code.

I have two applications: Felix runtime uses an exact collector
and also dynamically loads executable native code objects,
and Ocaml bytecode interpreter, where I'd like to support
unloading of plugins to provide compile time extensibility.
I believe Apache module plugins have a similar issue.

The key problem is defering unloading of the plugin code
until all references to it are unreachable, which clearly
excludes execution of finalisers encoded in the library,
as well as any pointers to static data.

My current thought is to use a per plugin static 
reference count, incremented when a closure over
some code pointer is created, and decremented
by a finaliser for that closure. I'm not sure
if this design actually works, or whether it
is practically implementable.

An alternative might be to somehow garbage collect
the code object. This may be faster, but seems to raise
some difficult issues about the representation of 
code pointers.

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net



-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-09  9:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-09  9:47 [Caml-list] GC and code unloading skaller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox