At 12:43 +0200 7/30/03, Leopold Toetsch wrote:
I have started looking at dynamic classes. I have currently
- new subdirectory /dynclasses
- small hack for classes/pmc2c.pl to consider this directory too
- dynclasses/foo.pmc, dynclasses/Makefile (unportable, but short ;-)

Here's what I was thinking instead.


We build classes as shared libraries, unless otherwise noted. PMC libraries get loaded up with an op--load_pmc or something of the sort. It takes a PMC name and tacks on the library prefix and suffix as need be. We load in the PMC library, call its setup routine, call its initialization routine, and let it do its thing. The setup routine, when called, will at the least register the PMC's class in the class name hash. There should be some code in the system to manage this, though it needs mutex protection.

The setup routine is called on library load. The initialization routine is called when the class is instantiated into a new interpreter. Setup stuff is done only once, initialization stuff is potentially done multiple times, though only once per interpreter--setup is for any initial load things (like linking to databases or whatever) while the initialization routine is for when a thread loads up a PMC class for the first time, but that class has already been loaded by another thread.

What we need to do is:

*) Determine the init and setup routine names
*) Make some standard for library paths and names
*) Figure out how we want to handle versioning

--
                                        Dan

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

Reply via email to