From: ch at lathspell.de (Christian Hammers) Date: Thu, 12 Dec 2013 10:37:19 +0100 Subject: [Pljava-dev] doubtful PL/Java's activity In-Reply-To: <2AB2177C63D24C43AC3BDE9A3A8F71FC1C86280C@G01JPEXMBYT02> References: <2AB2177C63D24C43AC3BDE9A3A8F71FC1C86280C@G01JPEXMBYT02> Message-ID: <20131212103719.723e5cfe@sys-251.netcologne.de> Hello On Mon, 9 Dec 2013 11:16:01 +0000 "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. If I understood it correctly, every PostgreSQL connection has its own process and for every such process one separate JVM is started. This model ensures that different connections never end up in the same JVM. Inside one connection queries are always executed one after another. Therefore the JVM can internally do what ever it likes, even multithreaded. Best Regards -christian-