At 5:32 PM -0500 1/19/04, Gordon Henriksen wrote:
Dan Sugalski wrote:

[A] copying collector is generally untenable in a threaded
environment.

Can you elaborate upon the reasoning behind this statement?


Sure. For a copying collector to work, all the mutators must be blocked, and arguably all readers should be blocked as well. (I think they need to be, otherwise you may be accessing reclaimed and reused memory) That means if we keep a copying collector we need to have everything that accesses strings or pmcs to get a lock on the GC before every access of every string or PMC. A touch excessive, I think. :)


> The first thing that any vtable function of a shared PMC must do is to

 aquire the mutex of the PMCs in its parameter list, in ascending
 address order. When the mutexes are released they are not required to
 be released in any order.

Note that this locking strategy cannot avoid deadlock if the user is allowed to acquire these locks--HLL locks must be altogether different beasts from automatic PMC locks. That's okay. Just a design consequence worth noting for everyone.

Oh, arguably it can't avoid deadlock at all, what with vtable methods having access to the full environment. I can live with deadlocks, only because there's no real alternative.
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to