Re: Is SPI safe to use in multi-threaded PL/Java?

From: "MauMau" <maumau307(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Is SPI safe to use in multi-threaded PL/Java?
Date: 2014-03-11 11:11:38
Message-ID: 7E4EA2768DA348879F571FE8193A2503@maumau
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> "MauMau" <maumau307(at)gmail(dot)com> writes:
>> To put the question in other words, is it safe to load a multi-threaded
>> PL
>> library in the single-threaded backend process, if the PL only calls SPI
>> in
>> the main thread?
>
> When it breaks, we're not going to be concerned.

I may not understand your nuance. Which of the following do you mean?

* PL/Java's design is dangerous in terms of the mixture of single- and
multi-threading, and we cannot be 100% sure whether there's really no
problem.

* SPI must not be used in multi-threaded process, even if only one thread
calls SPI functions at a time. So what we can say is that PL/Java is not
safe theoretically in terms of SPI.

Regards
MauMau

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Parul Lakkad 2014-03-11 11:24:57 Disk usage for intermediate results in join
Previous Message Rajeev rastogi 2014-03-11 10:28:10 Re: COPY table FROM STDIN doesn't show count tag