Prashanth Ellina wrote:
> Thanks for the code sample. I will try it out. I guess there is no
> reliable way to get away with just the "threads" module.
As "threading" is built on top of "thread", that statement seems wrong,
but the real question you should ask yourself is why you want to use the
Hi,
Thanks for the code sample. I will try it out. I guess there is no
reliable way to get away with just the "threads" module.
Thanks,
Prashanth Ellina
--
http://mail.python.org/mailman/listinfo/python-list
On 07.06.2005, at 16:44, harold fellermann wrote:
> import thread
>
> def parentThread() :
> lock = thread.allocate_lock()
> child = thread.start_new_thread(childThread,(parent,))
> lock.acquire()
>
> def childThread(parent) :
> parent.lock.acquire()
> do_something_w
On Tue, 07 Jun 2005 09:41:16 -0400, Peter Hansen wrote:
On Tue, 07 Jun 2005 06:28:33 -0700, Prashanth Ellina wrote:
> Hi,
>
> I have used the low-level thread module to write a multi-threaded app.
>
> tid = thread.start_new_thread(process, ())
> tid is an integer thread ident.
>
> the thread
I'm no threads expert, but if you use the higher-level "threading"
module, you could try something like this:
import threading
import time
def countToTen():
for i in range(1,11):
print i
time.sleep(0.5)
child = threading.Thread(target=countToTen)
class ma
we had some off-group mails. A summary is posted to improve the
knowledge
base of the list.
Prashanth wrote:
> Hi,
>
> I can use the threading module but I am just looking if there is a
> reliable way using the thread module.
>
> If I use a lock...
> Let us assume that the child thread has done
Prashanth Ellina wrote:
> I have used the low-level thread module to write a multi-threaded app.
>
> tid = thread.start_new_thread(process, ())
> tid is an integer thread ident.
>
> the thread takes around 10 seconds to finish processing. Meanwhile the
> main thread finished execution and exits.
Hi,
> I want a reliable way of knowing when the child
> thread finished execution so that I can make the main thread wait till
> then.
>
> Any ideas?
use a lock. the subthread allocates the lock and releases it after
processing.
the main thread must wait until the lock is released. otherwiese, u
Hi,
I have used the low-level thread module to write a multi-threaded app.
tid = thread.start_new_thread(process, ())
tid is an integer thread ident.
the thread takes around 10 seconds to finish processing. Meanwhile the
main thread finished execution and exits. This causes an error because
the