In <[EMAIL PROTECTED]>, Dara Durum wrote: > Under Python the threads are simulated by Python Interpreter as when > prev. setted pieces (interval) of the interpreted tokens are executed, > it is change to another "virtual" thread ? > > Or it was really create real threads, and they are figth for the > priority, and for the execution time ?
Both. CPython creates real threads but only one of those can be active at a time if python bytecode is executed because of the `global interpreter lock` (GIL). Extensions written in C can release that lock unless they are accessing the interpreter "internals". For example blocking IO calls like `file.read()` release the lock. > And can I create REAL threads under Python (just like in Delphi), or > better if I use processes, not threads ? Depends on the use case. If your program is IO bound i.e. many threads waiting for blocking IO then just use Python threads. If your task is computational intensive then it may be better to use processes and some form of inter process communication. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list