pacopyc wrote:
On 19 Giu, 00:27, MRAB wrote:
pacopyc wrote:
[snip]
Ok, the problem is that I want fix a time max for each thread. For
example run 10 threads (each can terminate its work in 10 sec. max
fixed time) and wait them. If they finish its work in < 10 sec. (for
example 2 sec.) very go
On 19 Giu, 00:27, MRAB wrote:
> pacopyc wrote:
>
> [snip]
> > Ok, the problem is that I want fix a time max for each thread. For
> > example run 10 threads (each can terminate its work in 10 sec. max
> > fixed time) and wait them. If they finish its work in < 10 sec. (for
> > example 2 sec.) very
pacopyc wrote:
[snip]
Ok, the problem is that I want fix a time max for each thread. For
example run 10 threads (each can terminate its work in 10 sec. max
fixed time) and wait them. If they finish its work in < 10 sec. (for
example 2 sec.) very good ... go on immediately (don't wait
unnecessa
On 18 Giu, 01:04, MRAB wrote:
> pacopyc wrote:
> > Hi, I'm trying to work with threads and I need your help. This is
> > code:
>
> > from threading import Thread
> > from Queue import Queue
> > import time
> > import random
>
> > def test_fun (k,q,t):
> > time.sleep(t)
> > print "hello wor
pacopyc wrote:
Hi, I'm trying to work with threads and I need your help. This is
code:
from threading import Thread
from Queue import Queue
import time
import random
def test_fun (k,q,t):
time.sleep(t)
print "hello world from thread " + str(q.get()) + " (sleep time =
" + str(t) + " sec.
Hi, I'm trying to work with threads and I need your help. This is
code:
from threading import Thread
from Queue import Queue
import time
import random
def test_fun (k,q,t):
time.sleep(t)
print "hello world from thread " + str(q.get()) + " (sleep time =
" + str(t) + " sec.)"
q.task_don