|
Prev: PIL(Py Image lib), show() not showing picture...
Next: site-packages, unzipepd there but import fails
From: Laszlo Nagy on 3 Jul 2008 06:40 Abhishek Asthana wrote: > > Hi all , > > I have large set of data computation and I want to break it into > small batches and assign it to different threads .I am implementing it > in python only. Kindly help what all libraries should I refer to > implement the multithreading in python. > You should not do this. Python can handle multiple threads but they always use the same processor. (at least in CPython.) In order to take advantage of multiple processors, use different processes. L
From: mimi.vx on 3 Jul 2008 07:00 On Jul 3, 12:40 pm, Laszlo Nagy <gand...(a)shopzeus.com> wrote: > Abhishek Asthana wrote: > > > Hi all , > > > I have large set of data computation and I want to break it into > > small batches and assign it to different threads .I am implementing it > > in python only. Kindly help what all libraries should I refer to > > implement the multithreading in python. > > You should not do this. Python can handle multiple threads but they > always use the same processor. (at least in CPython.) In order to take > advantage of multiple processors, use different processes. > > L or use parallelpython module, very good in multi processor| multimachine prog. in python
From: Kris Kennaway on 10 Jul 2008 18:49
Laszlo Nagy wrote: > Abhishek Asthana wrote: >> >> Hi all , >> >> I have large set of data computation and I want to break it into >> small batches and assign it to different threads .I am implementing it >> in python only. Kindly help what all libraries should I refer to >> implement the multithreading in python. >> > You should not do this. Python can handle multiple threads but they > always use the same processor. (at least in CPython.) In order to take > advantage of multiple processors, use different processes. Only partly true. Threads executing in the python interpreter are serialized and only run on a single CPU at a time. Depending on what modules you use they may be able to operate independently on multiple CPUs. The term to research is "GIL" (Global Interpreter Lock). There are many webpages discussing it, and the alternative strategies you can use. Kris |