Re: psycopg2 hang with multithread frequent queries

From: David Roid <dataroid(at)gmail(dot)com>
To: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>, "P(dot) Christeas" <xrg(at)linux(dot)gr>
Cc: psycopg(at)postgresql(dot)org
Subject: Re: psycopg2 hang with multithread frequent queries
Date: 2012-09-18 01:59:54
Message-ID: CAKN1bq4Uu2rNpT5FuDZ_Ouf+y+QhODw45Op6aX5i7PiSfWom7A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

Thank you, I'll do some homework on gevent.

-David

2012/9/18 Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>

> On Tue, Sep 18, 2012 at 12:39 AM, P. Christeas <xrg(at)linux(dot)gr> wrote:
> > On Tuesday 18 September 2012, David Roid wrote:
> >> Hi Daniele, Federico,
> >>
> >> Just want to know, if I keep signal handler but switch from thread to
> >> subprocess, i.e. put the signal handler code with database queries into
> >> another process, is that safe?
> >>
> >
> > IMHO, doing anything more than setting some "flag" variables and waking
> up
> > regular threads is bad practice for a signal handler..
>
> Yeah, in a process handler you are not even supposed to call malloc.
> This on top of the fact that in python interaction between threads and
> signals is unpredictable.
>
> If you want more refined synchronization across agents you may take a
> look at gevent/eventlet. But without knowing your problem is hard to
> guess a solution.
>
> -- Daniele
>
>
> --
> Sent via psycopg mailing list (psycopg(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/psycopg
>

In response to

Browse psycopg by date

  From Date Subject
Next Message Tobias Oberstein 2012-09-18 07:51:31 JSON type caster
Previous Message Daniele Varrazzo 2012-09-18 00:34:57 Re: psycopg2 hang with multithread frequent queries