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:
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)
2. 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?
3. 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
thread state messed up any time my thread is running. Which implies
unacceptable starvation of other threads.