[Tutor] Re: Creating Parent and child threads

Lee Harr missive at hotmail.com
Thu Nov 27 18:55:17 EST 2003

>Unfortunately this modified code is also not working
>here. I am not getting same output every time I
>execute this piece of code. Thus, I've just pasted the
>produced during one such executions.

I think that is expected when working with threads.

>The Output is shown below:
>Note: I've saved the code in Test.py and imported Test
>at the prompt.
>Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
>[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2
>Type "help", "copyright", "credits" or "license" for
>more information.
> >>> import threading
> >>> import Test

I don't see how this could be... if you have the code I posted
in the module Test, then you would have to do ...

import Test

or are you actually running some other code?

> >>> f1
> >>> threading.enumerate()
>[<_MainThread(MainThread, started)>,
><ParentThread(Thread-1, started)>,
><ParentThread(Thread-5, started)>,
><ChildThread(Thread-2, started)>,
><ChildThread(Thread-3, started)>,
><ParentThread(Thread-9, started)>,
><ChildThread(Thread-8, started)>]
> >>>
>These threads donot show any activity for long time
>and I am finally stopping all these threads
>explicitly. Also few parent threads aren't having all
>their child threads created. Why is this happening?
>Now, since this problem is not happening with you, is
>this problem related to any configuration settings?
>Regarding my implementation of functions f1, f2, f3:
>They were also simple functions just printing some
>arbitrary string.

I guess I recommend posting to the main python list
(I view it as comp.lang.python on usenet)

Make sure to include the exact code you are
using and the details of your system (python and os
versions and how you are running the code -- like if
you are in IDLE or konsole or gnome terminal)
along with the output you are getting and
the output that you expect to get.

STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 

More information about the Tutor mailing list