Nitro
Nitro

Reputation: 1293

Python multiprocessing start more processes than cores

Say I start 10 process in a loop using Process() but I only have 8 cores available. How does python handle this?

Upvotes: 5

Views: 2544

Answers (1)

Ouroborus
Ouroborus

Reputation: 16865

While best practice is to use as many threads as you have virtual cores available, you don't have to stick to that. Using less means you could be under-utilizing your available processor capacity. Using more means you'll be over-utilizing your available processor capacity.

Both these situations mean you'll be doing work at a slower rate than would otherwise be possible. (Though using more threads than you have cores has less of an impact than using fewer threads than your have cores.)

Upvotes: 4

Related Questions