starting a thread in a nother thread

Richard Lamboj richard.lamboj at bilcom.at
Wed Jan 27 09:23:35 EST 2010


Am Wednesday 27 January 2010 14:10:13 schrieb Stefan Behnel:
> Richard Lamboj, 27.01.2010 14:06:
> > just for _curiosity_. What would be if i start a thread in a nother
> > thread and acquire a lock in the "child" thread. Is there anything that
> > could go wrong if someone try to start threads in threads?
>
> There's usually tons of things that can go wrong w.r.t. threads:
>
> http://www.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-1.pdf
>
> However, there's nothing special to a thread that was started from another
> thread, so the problems don't change.
>
> Stefan

Hello,

i have tried a little bit around with psycopg2 and threads,

I'am sharing one connection for all threads. When i'am starting the 
threads "normal" everything works without any Problem. When i'am starting the 
threads from another thread than i got a "segmentation fault" - i'am using 
locks. I'am sending 2048 Reqeuest at once. The "normal" Methode with one 
thread for every Request needs 10 seconds. The other Methode starting a 
thread and starting two other threads from this thread crashes after 10 to 40 
requests with the segmentation fault error. Any Idea why? Its a 64 bit 
maschine. Maybe i'am making something wrong?

Kind Regards




More information about the Python-list mailing list