Re: Class var and class inst var caches in libraries
Posted by
GLASS mailing list on
Oct 10, 2016; 12:34am
URL: https://forum.world.st/Class-var-and-class-inst-var-caches-in-libraries-tp4918063p4918531.html
Thanks Dale and Paul. I've given up on making my libs #fork-safe on GS because after looking at the source for some of the GS(DevKit) methods I would use, I don't think they can guarantee it.
Instead I'm just focusing on preventing write conflicts. My solution now is forcing explicit initialization of normally lazy-initialized class/class inst vars in a Metacello postLoad on GS. Since the values are mostly immutable, they can be safely persisted, and since the mutable values are all instances of a custom dictionary-like cache class that uses a TransientRecursionLock to guard access to an internal collection wrapped in a TransientValue on GS, these instances can be safely persisted too. In my tests this eliminated all write conflicts, so XMLParser, XMLParserHTML, XMLParserStAX, XPath, and XMLWriter should all be conflict-free during normal use.
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass