Is it possible launch multiple threads on all available CPUs rather than one? An example code would be great.
Alternatively, can I span multiple processes and then create multi threading within each process?
I am using multithreading which works fine for IO side of my script. However, my script is also computation expensive so I would like to launch multiple threads on multiple CPUs.
My code flow:
def worker(url):
extract url (io bound)
process url content (cpu bound)
What should be the efficient way to deal with such type of worker?