![](https://secure.gravatar.com/avatar/f2201b39a10a577540dc244570807dfa.jpg?s=120&d=mm&r=g)
Sept. 2, 2008
7:54 a.m.
I am working on an application which embeds python in the application
threads and each thread can further create threads using the python thread
module
few things i don't understand:
thread state messed up any time my thread is running. Which implies
- why does the interpreter ie the main thread keeps releasing and
reacquiring the GIL every few instruction. why isn't GIL simply allowed to
be acquired by any thread which requires it then. I mean why is the
acquisition and release of a lock kept periodic and not on need basis?(
which is obviously the way it should be) - The purpose of GIL was not very clear to me from python-docs. is it just
a single lock to guard every global variable? or is it something more? - suppose I am not making any blocking call then I would never release GIL
since that is the only thing guarding my thread state and i don't want my
unacceptable starvation of other threads.