Re: beginner, thread & else

2006-12-15 Thread Gigs_
Fredrik Lundh wrote: > did you write that yourself, or did you find it in some book or article? This is the example from programming python 2nd book, I use this just for learning -- http://mail.python.org/mailman/listinfo/python-list

Re: beginner, thread & else

2006-12-15 Thread Hendrik van Rooyen
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > Gigs_ wrote: > > -- > > import thread > > the thread module should not be used directly by application programs; > use the "threading" module instead. Ooops! - I am doing this, for long running stuff. I was aware of

Re: beginner, thread & else

2006-12-14 Thread Fredrik Lundh
Gigs_ wrote: > can someone explain me this code did you write that yourself, or did you find it in some book or article? > -- > import thread the thread module should not be used directly by application programs; use the "threading" module instead. > stdoutmute

beginner, thread & else

2006-12-14 Thread Gigs_
can someone explain me this code: -- import thread stdoutmutex = thread.allocate_lock() exitmutexes = [0] * 10 def counter(myId, count): for i in range(count): stdoutmutex.acquire() print '[%s] => %s' % (myId, i) stdoutmutex.release()