Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5SCX5a91537 for ; Thu, 28 Jun 2001 08:33:05 -0400 (EDT) (envelope-from pgsql-jdbc-owner@postgresql.org) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5MDLAa69423 for ; Fri, 22 Jun 2001 09:21:10 -0400 (EDT) (envelope-from davec@sentricity.com) Received: (qmail 5230 invoked from network); 22 Jun 2001 13:21:01 -0000 Received: from eboxwest.ebox.com (HELO INSPIRON) (206.51.23.194) by net2.micro-automation.com with SMTP; 22 Jun 2001 13:21:01 -0000 From: "Dave Cramer" To: Cc: "'Bruce Momjian'" , "'Rainer Mager'" , "'PostgreSQL jdbc list'" Subject: RE: Re: [ADMIN] High memory usage [PATCH] Date: Fri, 22 Jun 2001 09:19:05 -0400 Message-ID: <000001c0fb1d$ee00d830$0201a8c0@INSPIRON> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 Importance: Normal In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by postgresql.org id f5MDLBa69431 X-Archive-Number: 200106/153 X-Sequence-Number: 900 On the thread safe issue: I am having a hard time understanding how one would share a statement across threads. I would expect that threadsafe just means don't use static buffers so that I can have multiple statements in multiple threads. I don't think it is possible to have two threads concurrently doing a query using one statement. This being said, I don't thing it is necessary to go to great lengths to lock within the statement as long as all the members within the statement are non-static. Comments? -----Original Message----- From: gunnar@polygnosis.com [mailto:gunnar@polygnosis.com] Sent: June 22, 2001 7:42 AM To: Dave Cramer Cc: Bruce Momjian; Rainer Mager; PostgreSQL jdbc list Subject: Re: [JDBC] Re: [ADMIN] High memory usage [PATCH] * "Dave Cramer" wrote: | | my two cents worth... | | 1) what is the problem that this is trying to solve, I assume from the | subject that it is some sort of high memory usage? I would like to know as well. | 2) I am trying to understand how a statement would ever be used by more than | one thread at a time? I would think that it would be impossible to share | statements across threads. Quite easy. Just the same way as you share any other object across threads and according to the JDBC spec requires that the driver shoudl be thread safe. | 3) The double locking method used is alledgedly unsafe on SMP machines | http://www.javaworld.com/javaworld/jw-02-2001/jw-0209-double_p.html. Yup, double checked locking is not going to guarantee that you get properly initialized objects with the current Java spec. -- Gunnar Rønning - gunnar@polygnosis.com Senior Consultant, Polygnosis AS, http://www.polygnosis.com/