En Mon, 23 Feb 2009 08:10:16 -0200, Gabriel Rossetti
<gabriel.rosse...@arimaz.com> escribió:
I would like to know if it is possible to turn python code into a shared
lib? I have several processes that use the same base code, and it seems
like every process loads the "shared" code into memory. I would like it
to be loaded once and shared, like a .so in linux or a .dll in windows
and have the interpreters use the dared copy. Is there a way to do this?
I don't think so.
What you consider "code" isn't usually just code: there are functions,
classes, instances, constants, modules, docstrings... a myriad of objects.
You can't share objects between processes.
Although true code objects are immutable and *could* be shared (with a lot
of work), I don't think code objects actually could take so much memory as
to be a problem.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list