Graham Dumpleton
grahamd at dscpl.com.au
Sun Oct 17 10:01:17 EDT 2004
On 16/10/2004, at 11:31 PM, Gregory (Grisha) Trubetskoy wrote: > > > On Sat, 16 Oct 2004, Graham Dumpleton wrote: > >> Since the Python apache.import_module() function is going to be called >> to load your content handler, and that has to do file i/o, would be a >> very >> good candidate for the GIL being given up and thus letting the other >> threads >> in to be able to check to see if the interpreter needs creating. > > I'm pretty sure Python already does release the GIL where necessary > (such as IO during import), so there is no need to do that from within > mod_python. I realise that Python already releases the GIL. I mentioned it as the reason why it possibly gets released and the other threads are getting in, not that we have to do it. :-) Anyway, import_module() is actually irrelevant in this case, as it isn't going to get called when the interpreter is being first created, but later. All the same, there will still be other stuff which can result in the GIL being released. This might be file i/o or it might be that Python will release it every so often when executing Python code in case there are other threads also running in Python code that want to do something. -- Graham Dumpleton (grahamd at dscpl.com.au)
|