From: pierce at hogranch.com (John R Pierce) Date: Sat, 15 Mar 2014 22:10:47 -0700 Subject: [Pljava-dev] Is it safe to use multi-threaded PL/Java in single-threaded postgres process? In-Reply-To: <0AF1495BB9BA466CAB0D57C2DCAB44DB@maumau> References: <30A6B4B499494CED93770BBC4835840C@maumau> <94B1FE06-4C37-488D-84C3-E4E4B0C94D24@me.com> <0AF1495BB9BA466CAB0D57C2DCAB44DB@maumau> Message-ID: <53253257.8070702@hogranch.com> On 3/15/2014 9:05 PM, MauMau wrote: > Could you elaborate on this? The details should be the answer I'm > looking for. > As I said as below, it doesn't seem that PL/Java obeys the JNI spec, > because pljava.so is not compiled with -mt, -D_REENTRANT nor > -D_POSIX_C_SOURCE. In short, I'd like to know why it is safe to make > JVM to load single-threaded pljava.so. > >>> FYI, JNI specification says that the code called from Java VM should >>> be built for multi-threading as follows. But postgres is not. ' JNI has two sides to it. nonjava stuff calling into java, and Java calling into non-java. pl/java implements the first style, non-java code (postgres core) calling java. -- john r pierce 37N 122W somewhere on the middle of the left coast