agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] doubtful PL/Java's activity
Date: Fri, 13 Dec 2013 10:01:24 +0200
Message-ID: <52AABED4.7090904@matrix.gatewaynet.com> (raw)
In-Reply-To: <52A970BB.8030904@tada.se>
References: <2AB2177C63D24C43AC3BDE9A3A8F71FC1C86280C@G01JPEXMBYT02>
	<52A970BB.8030904@tada.se>

Thanx Thomas,
for the insight.

On 12/12/2013 10:15, Thomas Hallgren wrote:
> PL/Java goes to some length in protecting the single threaded PostgreSQL kernel. All accesses to it must be made from the caller thread. Multiple threads can be used for background tasks but such 
> threads will be completely blocked from accessing the PostgreSQL functions.
>
> It works like this:
> A call is made from PostgreSQL. This call grabs a mutex.
> During PL/Java execution, only the thread that owns the mutex can call PostgreSQL.
> When the call eventually returns, the mutex is released.
>
> Java maintenance (garbage collection for instance) will still run in separate threads. If someone should write a finalizer that actually tries to do database access (god forbid), then that finalizer 
> would throw an exception.
>
> - thomas
>
> On 2013-12-09 12:16, Taniguchi, Yasunori wrote:
>> Hi,
>>
>> I'm investigating PL/Java and find out a doubtful fact.
>>
>> Postgres is compiled as a single thread application
>> and linked with JavaVM(.so/.dll) which is a multi thread library.
>> Sp, I think PL/Java's activity may not be assured.
>>
>> Thread-unsafe functions and global variables used in single thread
>> standard libraries may be inconsistent with multi thread libraries.
>>
>> Can anybody respond me ?
>>
>>
>> Regards.
>> -----
>> Y.Taniguchi
>>
>>
>> _______________________________________________
>> Pljava-dev mailing list
>> Pljava-dev at lists.pgfoundry.org
>> http://lists.pgfoundry.org/mailman/listinfo/pljava-dev
>
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at lists.pgfoundry.org
> http://lists.pgfoundry.org/mailman/listinfo/pljava-dev


-- 
Achilleas Mantzios




view thread (15+ messages)  latest in thread

Message-ID: <52AABED4.7090904@matrix.gatewaynet.com>
Permalink:  ../52AABED4.7090904@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/52AABED4.7090904@matrix.gatewaynet.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] doubtful PL/Java's activity
  In-Reply-To: <52AABED4.7090904@matrix.gatewaynet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox