Multithreading / multiprocess

TennesseeLeeuwenburg tleeuwenburg at gmail.com
Sun Apr 12 07:27:38 EDT 2009


On Apr 12, 2:59 am, a... at pythoncraft.com (Aahz) wrote:
> In article <57065c62-2024-47b5-a07e-1d60ff85b... at y10g2000prc.googlegroups.com>,
>
> tleeuwenb... at gmail.com <tleeuwenb... 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.

Thanks for your reply! Will add that to my reading list.

Cheers,
-T



More information about the Python-list mailing list