How to detect the number of threads i can & i should run?
<p>i have a 6th generation Intel i5 Processor (4 cores, 3 ghZ) and 8 gigabytes of RAM. Let's assume i need to create a text file which includes every number from 0 to 999999999. </p>

<p>How can  i make it faster? How many threads i should use? 4 or more than 4? How many threads i should run and why?</p>

<p>because of GIL you should use multiprocessing module. number of process should be:</p>

<pre><code>multiprocessing.cpu_count() - 1 # -1 for other system process.
</code></pre>

python multithreading