Peter Bex scripsit:

> The GC needs to be able to associate an object with its finalizers, so
> there either needs to be a global list or some extra slot added to
> each object.  The latter takes up more memory when you don't have a lot
> of finalizers (and finalizers are slow, so it's best not to generate too
> many of them).

How about if finalizers are only attached to pointers?  That seems to
be the principal use case, and adding a slot to a pointer (maybe only a
"finalizable tagged pointer" wouldn't be so expensive.

> What I don't quite understand is all this talk about threads.  The test
> program doesn't even create any extra threads, so how could there be any
> race conditions?  There shouldn't *be* any concurrency in this case,
> should there?

Even without the scheduler, the collector and the mutator are effectivevly
separate threads, because garbage collection happens unpredictably from
the point of view of the primordial thread.

-- 
A: "Spiro conjectures Ex-Lax."                  John Cowan
Q: "What does Pat Nixon frost her cakes with?"  [email protected]
  --"Jeopardy" for generative semanticists      http://www.ccil.org/~cowan

_______________________________________________
Chicken-hackers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to