Is it good to create a thread in a non gui thread?

Gabriel Genellina gagsl-py at yahoo.com.ar
Fri Dec 15 01:32:20 EST 2006


At Friday 15/12/2006 02:15, Lialie - KingMax wrote:

Please keep your posting on the list.

>Gabriel Genellina wrote:
> > At Thursday 14/12/2006 23:55, Lialie - KingMax wrote:
> >
> >> I create a thread in a non gui thread, and it does well. But it seems
> >> strange. Somebody told me better not for it may cause something hard to
> >> imagine.
> >> Is there any different between them?
> >
> > I'm not sure if I understand the question. You can have a non gui
> > application -an HTTP server by example- using many threads with no
> > problems.
> >
> >
>Thank you for your reply.
>
>I wrote a simple application with GUI. I create a thread to calculate
>data which may cost much time. So during the calculation, the interface
>can response. But one thread ONLY uses up half of my CPU(dual core)
>resource, I need more than two.
>The question is coming: where to create the thread? Create one more from
>GUI as the previous brother or as the child.
>-----------
>GUI thread
>|
>+------ First one --->
>|
>+------- start_new_thread -->
>---------------
>GUI thread
>|
>+--------First one --->
>|
>+--------start_new_thread ---->
>
>------------
>In my opinion, creating another thread from GUI thread or non gui thread
>are the same. Am I right?

Yes. Conceptually all threads are "brothers", it doesn't matter which 
thread created it, there is no parent/child relationship between them.
The only difference being the "main" thread who is responsible for 
the lifetime of the application.


-- 
Gabriel Genellina
Softlab SRL 

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar



More information about the Python-list mailing list