[Tutor] threading vs. forking?

Rodrigues op73418@mail.telepac.pt
Fri Jul 11 05:28:02 2003


> -----Original Message-----
> From: tutor-admin@python.org
> [mailto:tutor-admin@python.org]On Behalf Of
> Thomas CLive Richards
> Sent: sexta-feira, 11 de Julho de 2003 2:01
> To: tutor@python.org
> Subject: Re: [Tutor] threading vs. forking?
>
>
[Quote snipped]
>
> with "main" and "child" threads, am i correct when i say that if you
> only have two threads (a min and a child thread), you only
> actually need
> to create the child thread, and the main thread is just run
> as the rest
> of the program? (kind of like how it's done with forking)?
>
> or do you need to create two threads....hmmm..
>

Yes, you are correct. For a given process there is always one thread,
the main thread. This thread could be the Gui thread. You would spawn
a new thread to poll the port and set up a Queue where the child would
push its data.

> /me is confused
>
> --
>

With my best regards,
G. Rodrigues

> Thomi Richards,
> thomi@thomi.imail.net.nz
>