Open GoogleCodeExporter opened 9 years ago
Note that if preloading setup with WSGIImportScript or
process-group/application-group options to WSGIDaemonProcess, then should still
be on process startup.
Original comment by Graham.Dumpleton@gmail.com
on 27 Jan 2011 at 9:56
Possible problem with all this though is that code depends on fact that Python
interpreter initialisation is done from main Apache thread and that shutdown of
Python is then later done from same thread. In deferred initialisation, Python
will be initialised in a request thread, but then shutdown would be done in
main interpreter thread which had never called into the Python interpreter
before and so will not have an active thread state object. May just need to
initialise one first, but overall not sure if Python is going to do strange
things if shutdown from different thread than the one it was initialised from.
Original comment by Graham.Dumpleton@gmail.com
on 27 Jan 2011 at 10:00
Adding a patch which is a proof of concept to achieve true lazy loading which
achieves the above except correct thread synchronization for the
initialization. Adding this should be as simple as moving it below the mutex
locker and changing mutex initialization so that it occurs *before* the
initialization is done (since it currently initializes that mutex inside it.)
Also heads up for other problems like the shutting down from different thread
potential issue mentioned by graham above.
Original comment by landeh...@gmail.com
on 27 Jan 2011 at 11:24
Attachments:
Original issue reported on code.google.com by
Graham.Dumpleton@gmail.com
on 27 Jan 2011 at 9:55