no multithreading?

Nemeth Miklos nemeth at iqsoft.hu
Thu Jan 20 15:37:54 EST 2000


>       From:
>            Erno Kuusela
>
>
>
>
> >>>>> "moonseeker" == moonseeker  writes:
>
>     moonseeker> Hi!  I have understood that the python interpreter
>     moonseeker> switches to another thread if a fixed amount of python
>     moonseeker> commands is completed. Is this true?
>
> after a fixed number of bytecode instructions have been executed, yes.
> you can set it with sys.setcheckinterval().
>
>     moonseeker> That means if a task hangs on a command (i.e. file
>     moonseeker> open), all tasks are locked? What happens if I use
>     moonseeker> sleep() in a task?
>
> no, afaik i/o operations and sleep() and such release the interpreter
> lock, enabling other threads to excute.
>
This can only be implemented using real threads. If a Python thread is
about to execute a long operation implemented in C (for example a
database call), this thread will be blocked untill the called procedure
returns.
What operating system threads are going to execute the other Python
threads while this proc is running?

By the way I bought Mark Lutz's Programming Python, and I am a bit
disappointed that  he does not even mention multi-threading in the
870-page book.
Is there another book that explains more advanced features of Python?

NM

>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20000120/bc483deb/attachment.html>


More information about the Python-list mailing list