pg.ddx.io  pljava-dev@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Subject: [Pljava-dev] doubtful PL/Java's activity
Date: Fri, 20 Dec 2013 06:34:59 +0000
Message-ID: <2AB2177C63D24C43AC3BDE9A3A8F71FC1C86DAD5@G01JPEXMBYT02> (raw)
In-Reply-To: <52B3E01E.5000008@tada.se>
References: <2AB2177C63D24C43AC3BDE9A3A8F71FC1C86280C@G01JPEXMBYT02>
	<52A970BB.8030904@tada.se>
	<2AB2177C63D24C43AC3BDE9A3A8F71FC1C86B431@G01JPEXMBYT02>
	<52AAA743.40309@tada.se>
	<2AB2177C63D24C43AC3BDE9A3A8F71FC1C86DA16@G01JPEXMBYT02>
	<52B3E01E.5000008@tada.se>

Hi, Mr. Thomas,

"application" I described means general application like postgres, PL/Java library, JavaVM and so on.
It's not database client application.

postgres(single thread compiled) <=> PL/Java lib(multi thread compiled) <=> JavaVM lib(multi thread compiled)


My recognition is :

- no global variable is passed across between postgres and PL/Java lib, JavaVM lib
 (only function arguments and return value are passed across.)

- PL/Java lib, JavaVM lib functions never call functions in postgres lib.



Regards, Taniguchi


-----Original Message-----
From: pljava-dev-bounces at lists.pgfoundry.org [mailto:pljava-dev-bounces at lists.pgfoundry.org] On Behalf Of Thomas Hallgren
Sent: Friday, December 20, 2013 3:14 PM
To: pljava-dev at lists.pgfoundry.org
Subject: Re: [Pljava-dev] doubtful PL/Java's activity

On 2013-12-20 05:51, Taniguchi, Yasunori wrote:
> Thank you, Mr. Thomas,
>
> Sorry for my late response.
>
>> The backend is single threaded (each connection runs in it's own process and it's own JVM) so there will never be two functions executing simultanously.
> Yes, I understand.
> But, multi thread applications (unless using concurrent JDBC  call) can run in JavaVM even if postgres backend is single threaded, I think.

Each connection that a multi threaded client application opens is attached to one single threaded backend process and hence, each connection will run in its own JVM. These connections cannot access the same global data since they live in different process spaces.

- thomas

_______________________________________________
Pljava-dev mailing list
Pljava-dev at lists.pgfoundry.org
http://lists.pgfoundry.org/mailman/listinfo/pljava-dev



view thread (15+ messages)  latest in thread

Message-ID: <2AB2177C63D24C43AC3BDE9A3A8F71FC1C86DAD5@G01JPEXMBYT02>
Permalink:  ../2AB2177C63D24C43AC3BDE9A3A8F71FC1C86DAD5@G01JPEXMBYT02/
Also on:    postgresql.org/message-id/2AB2177C63D24C43AC3BDE9A3A8F71FC1C86DAD5@G01JPEXMBYT02

 · 

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: <2AB2177C63D24C43AC3BDE9A3A8F71FC1C86DAD5@G01JPEXMBYT02>

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

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