Re: psycop2 and threads
Eric Chamberlain <Eric.Chamberlain-/Guk6kGqSwklJZD/[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
One more thing to add. I'm not sure how using the same connection between different processes would work. I would suggest creating a new connection for every process. Good luck! On Jan 27, 2010, at 9:41 AM, Eric Chamberlain wrote: > I have ran across this same issue. I don't believe it's a psycopg2 problem but a problem with Python (someone please correct me if I'm wrong). What I did to overcome this is to use the processing module. You're making processes instead of threads, but you gain two huge advantages. One, because it's a process, you don't run against the GIL -- so you get huge performance gains on processor intensive tasks. And two you can make a process within a process. The processing module uses the same interface as the threading library, so it's trivial to implement. > > http://pyprocessing.berlios.de/doc/index.html > > On Jan 27, 2010, at 7:04 AM, Richard Lamboj wrote: > >> >> Hello, >> >> i'am using psycop2 from debian lenny in python. I'am sharing one connection >> between threads. This works without any Problem(Yes i'am using locks!). But >> when i'am starting more then one thread in another thread, then i got a >> segmentation fault. >> >> - request thread >> - psycop2 thread >> - antoher thread >> _______________________________________________ >> Psycopg mailing list >> Psycopg-IAPFreCvJWPBWskQ1e/[email protected] >> http://lists.initd.org/mailman/listinfo/psycopg > > > Confidentiality Notice: This e-mail may contain proprietary information some of which may be legally privileged. It is for the intended recipient(s) only. If you believe that it has been sent to you in error, please notify the sender by reply e-mail and delete the message. Any disclosure, copying, distribution or use of this information by someone other than the intended recipient(s) is prohibited and may be unlawful. > _______________________________________________ > Psycopg mailing list > Psycopg-IAPFreCvJWPBWskQ1e/[email protected] > http://lists.initd.org/mailman/listinfo/psycopg Confidentiality Notice: This e-mail may contain proprietary information some of which may be legally privileged. It is for the intended recipient(s) only. If you believe that it has been sent to you in error, please notify the sender by reply e-mail and delete the message. Any disclosure, copying, distribution or use of this information by someone other than the intended recipient(s) is prohibited and may be unlawful.