no multithreading?

Erno Kuusela erno at iki.fi
Wed Jan 19 19:56:50 EST 2000


>>>>> "moonseeker" == moonseeker  <moonseeker at my-deja.com> 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.

   -- erno



More information about the Python-list mailing list