From: Joel VanderWerf Date: 2007-01-25T04:21:34+09:00 Subject: Re: Ruby for massively multi-core chips? Ron M wrote: > M. Edward (Ed) Borasky wrote: ... >> only thing that would be sharable is the memory used for code ("text" in >> Linux terms). > > Nope. Many (all?) OS's do copy-on-write. If one parent > forked the other children after a lot of initialization > was done, all that data initialized by the parent (including, > for example, loaded ruby modules, etc) would be shared too. That doesn't play well with ruby's gc, which touches reachable objects (parse trees are another matter). Maybe there's a way to tell GC that all objects existing at the time of fork should be considered permanently reachable, so that their memory is never copied in the child due to mark(). This way you could set up a basic set of objects that children could add to but never collect. Might be useful for special purposes, but not in general. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407