Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python pool map and choosing number of processes

In setting the number of processes, I'd be keen to see how many threads I can actually use on my machine - how do I find this? Is there a way to determine the number of threads available to me?

like image 396
disruptive Avatar asked Jul 31 '14 11:07

disruptive


1 Answers

Do you want to know the CPU count?

According to the docs, when you start a pool and don't sepecify the number of processes, the default number is the number of cpu's on the system:

processes is the number of worker processes to use. If processes is None then the number returned by cpu_count() is used. If initializer is not None then each worker process will call initializer(*initargs) when it starts.

like image 137
Yann Avatar answered Oct 25 '22 21:10

Yann