Re: plperlu stored procedure seems to freeze for a minute - Mailing list pgsql-general

From Tom Lane
Subject Re: plperlu stored procedure seems to freeze for a minute
Date
Msg-id 16344.1448993607@sss.pgh.pa.us
Whole thread Raw
In response to Re: plperlu stored procedure seems to freeze for a minute  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Responses Re: plperlu stored procedure seems to freeze for a minute  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
List pgsql-general
"Peter J. Holzer" <hjp-pgsql@hjp.at> writes:
> But there is something else which may be relevant: �MQ uses threads
> internally, and I don't actually know whether zmq_msg_recv returning
> means that the read(2) call (or whatever) on the socket terminates.

... ugh ...

> Postgres worker processes are single-threaded, are they? Is there
> something else which could interact badly with a moderately complex
> multithreaded I/O library used from a stored procedure?

Yes, lots.  If you cause additional threads to appear inside a backend
process, things could break arbitrarily badly.  It's up to you to ensure
that none of those extra threads ever escape to execute any non-Perl
code.  I suspect this could easily explain the problems you're seeing.

            regards, tom lane


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: 2 questions
Next
From: Adrian Klaver
Date:
Subject: Re: plperlu stored procedure seems to freeze for a minute