Re: [PATCHES] Thread-safe PREPARE in ecpg

2007-09-26 Thread Michael Meskes
On Wed, Sep 26, 2007 at 01:43:34PM +0900, ITAGAKI Takahiro wrote:
 Here is a revised patch against CVS HEAD.
 I fixed a bug in ECPGdeallocate_all().

Applied to CVS HEAD. I also added your example to the regression tests.

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: [EMAIL PROTECTED]
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [PATCHES] Thread-safe PREPARE in ecpg

2007-09-25 Thread Michael Meskes
On Tue, Sep 25, 2007 at 03:22:13PM +0900, ITAGAKI Takahiro wrote:
 Here is a WIP patch to make prepared statements thread-safe in ecpg.
 The variable prep_stmts was global but not protected by any locks.
 I divided it into per-connection field so that we can access prepared
 statements separately in each thread.

Thanks a lot. This is exactly how I was planning to implement it, but I
haven't even found the time to start coding yet. :-)

Could you please create a small example that we could add to the
regression suite?

 I needed to change the following exported functions, but it will
 introduce an incompatibility issue. It might be ok for CVS HEAD,
 but I'd like to port the fix to back versions. Do you have any
 thoughts on how we can accomplish this better?

No idea at the moment, sorry. 

Michael
-- 
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: [EMAIL PROTECTED]
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [PATCHES] Thread-safe PREPARE in ecpg

2007-09-25 Thread ITAGAKI Takahiro
Here is a revised patch against CVS HEAD.
I fixed a bug in ECPGdeallocate_all().

Michael Meskes [EMAIL PROTECTED] wrote:

 Could you please create a small example that we could add to the
 regression suite?

The attached prep.pgc is an example for this fix,
that repeats EXEC SQL PREPARE and EXECUTE in loops.
It works with pthread and Win32 thread.

  I needed to change the following exported functions, but it will
  introduce an incompatibility issue. It might be ok for CVS HEAD,
  but I'd like to port the fix to back versions. Do you have any
  thoughts on how we can accomplish this better?
 
 No idea at the moment, sorry. 

For porting back to 8.2, I'm planning to keep ECPGdeallocate,
ECPGdeallocate_all and ECPGprepared_statement as their original names,
and add new versions with different names. If users use only thread
default connection, the simplified version would work enough.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center



ecpg_prepare-8.3.patch
Description: Binary data


prep.pgc
Description: Binary data

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [PATCHES] thread safety testing fix

2004-05-28 Thread Tom Lane
Andreas Pflug [EMAIL PROTECTED] writes:
 When checking for thread safety with src/tools/thread/thread_test.c, the 
 mktemp function wants an argument that contains 6 X, while the current 
 version only supplies 5 X which will fail on my SuSE 8.1.
 Patch attached.

Isn't this going to break platforms that only want 5 X's ?

regards, tom lane

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


Re: [PATCHES] thread safety testing fix

2004-05-28 Thread Andreas Pflug
Tom Lane wrote:
Andreas Pflug [EMAIL PROTECTED] writes:
 

When checking for thread safety with src/tools/thread/thread_test.c, the 
mktemp function wants an argument that contains 6 X, while the current 
version only supplies 5 X which will fail on my SuSE 8.1.
Patch attached.
   

Isn't this going to break platforms that only want 5 X's ?
Probably not., any additional X will just be ignored.
AFAICS all platforms want at least 6 X anyway.
Regards,
Andreas
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
   (send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [PATCHES] thread safety testing fix

2004-05-28 Thread Bruce Momjian
Tom Lane wrote:
 Andreas Pflug [EMAIL PROTECTED] writes:
  When checking for thread safety with src/tools/thread/thread_test.c, the 
  mktemp function wants an argument that contains 6 X, while the current 
  version only supplies 5 X which will fail on my SuSE 8.1.
  Patch attached.
 
 Isn't this going to break platforms that only want 5 X's ?

My BSD/OS doesn't specify a specific number of X's, but it does use an
example with six, so six should be fine.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 8: explain analyze is your friend