In article <57065c62-2024-47b5-a07e-1d60ff85b...@y10g2000prc.googlegroups.com>, tleeuwenb...@gmail.com <tleeuwenb...@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 (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ Why is this newsgroup different from all other newsgroups? -- http://mail.python.org/mailman/listinfo/python-list