Python Parallel Threading
<p>so basicly I created this program that adds values to redis. So far I get this for time:</p>

<pre><code>real 0m27.759s
user 0m18.129s
sys  0m5.580s
</code></pre>

<p>however when I tried to run multiple threads:</p>

<pre><code>if __name__ == '__main__':
try:
    for x in range(0,NUM_THREADS):
                    Thread(None,startProgram,None,
                          (NUM_HOSTS/NUM_THREADS*x+1,NUM_HOSTS/NUM_THREADS*(x+1))
                    ).start()
except Exception as errtxt:
    print errtxt
</code></pre>

<p>I get this with <code>NUM_THREADS=10</code>:</p>

<pre><code>real 0m32.642s
user 0m22.953s
sys  0m11.473s
</code></pre>

<p>Why is my program running <em>slower</em> with <em>more</em> threads?</p>

<p>Im running linux Ubuntu 11.04 and Python 2.7.1</p>
