On 12/24/2009 2:11 PM, Gib Bogle wrote:
Lie Ryan wrote:
On 12/22/2009 10:47 AM, Gib Bogle wrote:
It turns out that this code isn't a great demo of the advantages of
threading, on my system anyway. The time taken to execute doesn't vary
much when the number of threads is set anywhere from 1 to 6
Lie Ryan wrote:
On 12/22/2009 10:47 AM, Gib Bogle wrote:
This is indented over one indentation level too much. You want it to
be at the same level as the for above. Here, its at the same level
with "t" -- meaning this entire loop gets repeated five times.
I sorta really recommend a tab width of
On 12/22/2009 10:47 AM, Gib Bogle wrote:
This is indented over one indentation level too much. You want it to
be at the same level as the for above. Here, its at the same level
with "t" -- meaning this entire loop gets repeated five times.
I sorta really recommend a tab width of 4 spaces, not 2
Stephen Hansen wrote:
On Mon, Dec 21, 2009 at 3:12 PM, Gib Bogle
wrote:
#spawn a pool of threads, and pass them queue instance
for i in range(5):
t = ThreadUrl(queue,i)
t.setDaemon(True)
t.start()
#populate queue with data
for host in hosts:
queue.put(host)
This is indent
Stephen Hansen wrote:
On Mon, Dec 21, 2009 at 3:12 PM, Gib Bogle
wrote:
#spawn a pool of threads, and pass them queue instance
for i in range(5):
t = ThreadUrl(queue,i)
t.setDaemon(True)
t.start()
#populate queue with data
for host in hosts:
queue.put(host)
This is indent
On Mon, Dec 21, 2009 at 3:24 PM, Stephen Hansen wrote:
> This is indented over one indentation level too much. You want it to
> be at the same level as the for above. Here, its at the same level
> with "t" -- meaning this entire loop gets repeated five times.
Err, "this" in this context meant the
On Mon, Dec 21, 2009 at 3:12 PM, Gib Bogle
wrote:
> #spawn a pool of threads, and pass them queue instance
> for i in range(5):
> t = ThreadUrl(queue,i)
> t.setDaemon(True)
> t.start()
>
> #populate queue with data
> for host in hosts:
> queue.put(host)
This is indented over o
Hi,
I'm learning Python, jumping in the deep end with a threading application. I
came across an authoritative-looking site that recommends using queues for
threading in Python.
http://www.ibm.com/developerworks/aix/library/au-threadingpython/index.html
The author provides example code that fet