As we know, python has the concept of global interpreter lock(GIL), that is, only one thread can be really running in the python virtual machine at any point in time. Python threads must acquire a single shared lock (GIL) when they are ready to run, and each thread may be swapped out after running for a set number of virtual machine instructions. So python threads have a bad reputation of performance because they can not really run concurrently.
For IcePy, its threads or thread pools comes from Ice.so written by C++. Does it have the constrait of GIL ?
For example, this is a simple slice file:
Code:
module Demo
{
interface Printer
{
void printString(string s);
};
};
This is the server implementation:
Code:
class PrinterI(Demo.Printer):
def printString(self, s, current=None):
print s
# there are many other computation to do
# ...
Suppose Ice.ThreadPool.Server.Size=5 and there are 5 clients send request to the server simultaneously, how does GIL play its role ? Are there any principles ?