Skip to content Skip to sidebar Skip to footer

Multiprocessing On A Single Core?

I was using this following example to try & figure out the multiprocessing module in Python, but then I started to wonder, what happens when you try & multiproccess on a si

Solution 1:

One of the functions of the operating system is task scheduling. And that is exactly what would happen. All your threads would be added to the scheduler list and it would check on each task regularly and run each one for a short time. Since all your workers do is sleep, it would probably only check on them at the start and at the end (the system call for sleep tells the scheduler that the task is not going to need any processing for some time).


Post a Comment for "Multiprocessing On A Single Core?"