Multithreading / multiprocess

Aahz aahz at
Sat Apr 11 18:59:57 CEST 2009

In article <57065c62-2024-47b5-a07e-1d60ff85ba23 at>,
tleeuwenburg at <tleeuwenburg at> wrote:
>Is there anyway to begin a thread and execute a finite number of lines
>of code, or a finite amount of time within it?
>For example, say I create three child threads and I want to guarantee
>equal timeshare between them, can I specify a quanta (say 400 LOC
>although I know that is pretty small) to execute in each one in turn?

You have extremely coarse-grained control with sys.setcheckinterval().
However, there is no guarantee which thread will pick up control after
each context switch, so one thread might get more than its share.
Aahz (aahz at           <*>

Why is this newsgroup different from all other newsgroups?

More information about the Python-list mailing list