Multithreading / multiprocess

Aahz aahz at pythoncraft.com
Sat Apr 11 12:59:57 EDT 2009


In article <57065c62-2024-47b5-a07e-1d60ff85ba23 at y10g2000prc.googlegroups.com>,
tleeuwenburg at gmail.com <tleeuwenburg at gmail.com> 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 pythoncraft.com)           <*>         http://www.pythoncraft.com/

Why is this newsgroup different from all other newsgroups?



More information about the Python-list mailing list