Re: Safe to call Py_Initialize() frequently?

2009-03-29 Thread Aahz
[pe] In article e97efd52-4868-47a5-91ec-657bba5f0...@z16g2000prd.googlegroups.com, Graham Dumpleton graham.dumple...@gmail.com wrote: In mod_wsgi however, Apache will completely unload the mod_wsgi module on a restart. This would also mean that the Python library is also unloaded from memory.

Re: Safe to call Py_Initialize() frequently?

2009-03-29 Thread Graham Dumpleton
On Mar 30, 4:35 am, a...@pythoncraft.com (Aahz) wrote: [pe] In article e97efd52-4868-47a5-91ec-657bba5f0...@z16g2000prd.googlegroups.com, Graham Dumpleton  graham.dumple...@gmail.com wrote: In mod_wsgi however, Apache will completely unload the mod_wsgi module on a restart. This would

Re: Safe to call Py_Initialize() frequently?

2009-03-23 Thread Mark Hammond
On 23/03/2009 12:14 PM, Graham Dumpleton wrote: On Mar 21, 10:27 am, Mark Hammondskippy.hamm...@gmail.com wrote: Calling Py_Initialize and Py_Finalize multiple times does leak (Python 3 has mechanisms so this need to always be true in the future, but it is true now for non-trivial apps.

Re: Safe to call Py_Initialize() frequently?

2009-03-23 Thread Graham Dumpleton
On Mar 23, 10:00 pm, Mark Hammond skippy.hamm...@gmail.com wrote: On 23/03/2009 12:14 PM, Graham Dumpleton wrote: On Mar 21, 10:27 am, Mark Hammondskippy.hamm...@gmail.com  wrote: Calling Py_Initialize and Py_Finalize multiple times does leak (Python 3 has mechanisms so this need to

Re: Safe to call Py_Initialize() frequently?

2009-03-22 Thread Graham Dumpleton
On Mar 21, 2:35 pm, roschler robert.osch...@gmail.com wrote: On Mar 20, 7:27 pm, Mark Hammond skippy.hamm...@gmail.com wrote: On 21/03/2009 4:20 AM, roschler wrote: Calling Py_Initialize() multiple times has no effect.  Calling Py_Initialize and Py_Finalize multiple times does leak

Re: Safe to call Py_Initialize() frequently?

2009-03-22 Thread Graham Dumpleton
On Mar 21, 10:27 am, Mark Hammond skippy.hamm...@gmail.com wrote: Calling Py_Initialize and Py_Finalize multiple times does leak (Python 3 has mechanisms so this need to always be true in the future, but it is true now for non-trivial apps. Mark, can you please clarify this statement you are

Safe to call Py_Initialize() frequently?

2009-03-20 Thread roschler
I've created a Python server that embeds Python 2.5 and runs Python jobs. I want to be able to completely flush the interpreter between each job. That means resetting all variables, stopping all user created threads, and resetting the interpreter sys module path. If it does not cause memory

Re: Safe to call Py_Initialize() frequently?

2009-03-20 Thread Mark Hammond
On 21/03/2009 4:20 AM, roschler wrote: I've created a Python server that embeds Python 2.5 and runs Python jobs. I want to be able to completely flush the interpreter between each job. That means resetting all variables, stopping all user created threads, and resetting the interpreter sys

Re: Safe to call Py_Initialize() frequently?

2009-03-20 Thread roschler
On Mar 20, 7:27 pm, Mark Hammond skippy.hamm...@gmail.com wrote: On 21/03/2009 4:20 AM, roschler wrote: Calling Py_Initialize() multiple times has no effect.  Calling Py_Initialize and Py_Finalize multiple times does leak (Python 3 has mechanisms so this need to always be true in the future,