Re: [HACKERS] Threads in PostgreSQL

2015-12-20 Thread Konstantin Knizhnik
Hi, PostgreSQL is not using threads but it is possible to spawn thread in your PostgreSQL extensions. For example, I have used pool of threads in my IMCS extension. But you need to build your extension with -pthread: CUSTOM_COPT = -pthread Also, please take in account that many PostgreSQL fu

Re: [HACKERS] Threads in PostgreSQL

2015-12-20 Thread Chapman Flack
On 12/21/15 01:24, Atri Sharma wrote: > On Mon, Dec 21, 2015, sri harsha wrote: > >> I am using threads in my >> foreign data wrapper and i get the following error when i use the threads . >> >> *ERROR: stack depth limit exceeded* >> *HINT: Increase the configuration parameter "max_stack_depth"

Re: [HACKERS] Threads in PostgreSQL

2015-12-20 Thread Atri Sharma
On Mon, Dec 21, 2015 at 11:51 AM, sri harsha wrote: > Hi, > >Is it possible to use threads in Postgresql ?? I am using threads in my > foreign data wrapper and i get the following error when i use the threads . > > *ERROR: stack depth limit exceeded* > *HINT: Increase the configuration para

[HACKERS] Threads in PostgreSQL

2015-12-20 Thread sri harsha
Hi, Is it possible to use threads in Postgresql ?? I am using threads in my foreign data wrapper and i get the following error when i use the threads . *ERROR: stack depth limit exceeded* *HINT: Increase the configuration parameter "max_stack_depth" (currently 2048kB), after ensuring the pla

Re: [HACKERS] threads stuff/UnixWare

2004-05-13 Thread Bruce Momjian
Larry Rosenman wrote: > > Really? You are configuring with --enable-thread-safety? I just > > updated your template in CVS, and it is attached. However, any old CVS > > should work fine. > Nope, initdb is where we still die: > OH! I remember now. What we have to do for this platform only is

Re: [HACKERS] threads stuff/UnixWare

2004-05-13 Thread Larry Rosenman
--On Thursday, May 13, 2004 11:44:59 -0400 Bruce Momjian <[EMAIL PROTECTED]> wrote: Larry Rosenman wrote: -- Start of PGP signed section. --On Thursday, May 13, 2004 10:05:22 -0400 Bruce Momjian <[EMAIL PROTECTED]> wrote: > Basically, as things set right now in CVS, Unixware is ready to go >

Re: [HACKERS] threads stuff/UnixWare

2004-05-13 Thread Bruce Momjian
Larry Rosenman wrote: -- Start of PGP signed section. > > > --On Thursday, May 13, 2004 10:05:22 -0400 Bruce Momjian > <[EMAIL PROTECTED]> wrote: > > > > Basically, as things set right now in CVS, Unixware is ready to go > > because it thread for everything. We don't have per-template thread

Re: [HACKERS] threads stuff/UnixWare

2004-05-13 Thread Larry Rosenman
--On Thursday, May 13, 2004 10:05:22 -0400 Bruce Momjian <[EMAIL PROTECTED]> wrote: Basically, as things set right now in CVS, Unixware is ready to go because it thread for everything. We don't have per-template thread settings anymore because we test all of it in configure. Was a change made

Re: [HACKERS] threads stuff/UnixWare

2004-05-13 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > Larry Rosenman wrote: > >> I agree. the only issue is how to set up our makefiles to only do the > >> -Kpthread/-pthreads(gcc) flags on the client code, and not do it for > >> the backend itself. > > > I think mixing a pgport that ha

Re: [HACKERS] threads stuff/UnixWare

2004-05-13 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Larry Rosenman wrote: >> I agree. the only issue is how to set up our makefiles to only do the >> -Kpthread/-pthreads(gcc) flags on the client code, and not do it for >> the backend itself. > I think mixing a pgport that has thread flags with a backend

Re: [HACKERS] threads stuff/UnixWare

2004-05-13 Thread Bruce Momjian
Larry Rosenman wrote: -- Start of PGP signed section. > > > --On Thursday, May 13, 2004 09:18:21 -0400 Tom Lane <[EMAIL PROTECTED]> > wrote: > > > Larry Rosenman <[EMAIL PROTECTED]> writes: > >> I did get a note from my SCO contacts that they are looking into how > >> to make it easier for stuf

Re: [HACKERS] threads stuff/UnixWare

2004-05-13 Thread Larry Rosenman
--On Thursday, May 13, 2004 09:18:21 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: Larry Rosenman <[EMAIL PROTECTED]> writes: I did get a note from my SCO contacts that they are looking into how to make it easier for stuff to be threads ready, but I don't expect that to be ready for 7.5 release. T

Re: [HACKERS] threads stuff/UnixWare

2004-05-13 Thread Tom Lane
Larry Rosenman <[EMAIL PROTECTED]> writes: > I did get a note from my SCO contacts that they are looking into how > to make it easier for stuff to be threads ready, but I don't expect > that to be ready for 7.5 release. > The -Kpthread on all libpq using programs is the easiest way FOR NOW. Hmm.

Re: [HACKERS] threads stuff/UnixWare

2004-05-13 Thread Larry Rosenman
--On Thursday, May 13, 2004 09:54:02 +0200 Zeugswetter Andreas SB SD <[EMAIL PROTECTED]> wrote: I know, this sucks, but, I don't see any other way, other than linking *ALL* libpq-using programs (including initdb and friends) with -K pthread. How about making a libpq.so (without pthread) and a

Re: [HACKERS] threads stuff/UnixWare

2004-05-13 Thread Zeugswetter Andreas SB SD
> I know, this sucks, but, I don't see any other way, other than linking > *ALL* libpq-using programs (including initdb and friends) with -K pthread. How about making a libpq.so (without pthread) and a thread safe libpq_r.so ? Andreas ---(end of broadcast)---

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Larry Rosenman
--On Wednesday, May 12, 2004 22:26:03 -0400 Bruce Momjian <[EMAIL PROTECTED]> wrote: Larry Rosenman wrote: Yes, there would still be the overhead, because the functions that libthread wraps would go through that overhead since libthread does it's magic at _ini time. Y'all were concerned with ov

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Bruce Momjian
Larry Rosenman wrote: > Yes, there would still be the overhead, because the functions that > libthread wraps would go through that overhead since libthread does it's > magic at _ini time. > > Y'all were concerned with overhead in previous discussions. > > If you want to link the backend with -K

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Larry Rosenman
--On Wednesday, May 12, 2004 21:55:40 -0400 Bruce Momjian <[EMAIL PROTECTED]> wrote: Larry Rosenman wrote: > [ Sorry I have been away from email today. ] > > Larry, now that I have put the thread testing into configure, I am > ready to deal with Unixware. In fact I posted to the list asking yo

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Bruce Momjian
Larry Rosenman wrote: > > [ Sorry I have been away from email today. ] > > > > Larry, now that I have put the thread testing into configure, I am ready > > to deal with Unixware. In fact I posted to the list asking you about it > > but was too lazy to look up your email address. > > > > Anyway, I

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Larry Rosenman
--On Wednesday, May 12, 2004 21:08:25 -0400 Bruce Momjian <[EMAIL PROTECTED]> wrote: Tom Lane wrote: Larry Rosenman <[EMAIL PROTECTED]> writes: >> Please save us all time searching by providing a URL ... > I can't find my posts on archives.postgresql.org, but can find it in > MY archives. Well,

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Bruce Momjian
Tom Lane wrote: > Larry Rosenman <[EMAIL PROTECTED]> writes: > >> Please save us all time searching by providing a URL ... > > > I can't find my posts on archives.postgresql.org, but can find it in > > MY archives. > > Well, then we won't be able to find 'em either, so please repost. > > > This

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Tom Lane
Larry Rosenman <[EMAIL PROTECTED]> writes: >> Please save us all time searching by providing a URL ... > I can't find my posts on archives.postgresql.org, but can find it in > MY archives. Well, then we won't be able to find 'em either, so please repost. > This is heading down the same path I wa

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Marc G. Fournier
On Wed, 12 May 2004, Larry Rosenman wrote: > > k, a change that 'sucks', vs linking against -Kpthread ... I'm for the > > -Kpthread route myself, which still sounds the 'clean' solution ... > that was rejected back in Jan-Mar. > > BUT, I agree it would work. > > I tried to submit the patch, and it

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Marc G. Fournier
On Wed, 12 May 2004, Larry Rosenman wrote: > > > --On Wednesday, May 12, 2004 16:00:48 -0400 Tom Lane <[EMAIL PROTECTED]> > wrote: > > > Larry Rosenman <[EMAIL PROTECTED]> writes: > >> --On Wednesday, May 12, 2004 15:39:54 -0400 Tom Lane > >> <[EMAIL PROTECTED]>=20 wrote: > >>> At this point I'd s

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Larry Rosenman
--On Wednesday, May 12, 2004 17:29:30 -0300 "Marc G. Fournier" <[EMAIL PROTECTED]> wrote: On Wed, 12 May 2004, Larry Rosenman wrote: --On Wednesday, May 12, 2004 16:00:48 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: > Larry Rosenman <[EMAIL PROTECTED]> writes: >> --On Wednesday, May 12, 2004 15

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Larry Rosenman
--On Wednesday, May 12, 2004 16:22:58 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: Larry Rosenman <[EMAIL PROTECTED]> writes: I was thinking of pq_pthread_* calls, and that function would set a static flag for calling either the real pthread_* function or a statically named version in libpgport.a

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Tom Lane
Larry Rosenman <[EMAIL PROTECTED]> writes: > I was thinking of pq_pthread_* calls, and that function would > set a static flag for calling either the real pthread_* function > or a statically named version in libpgport.a that is a single thread > wrapper. And how will you avoid having a link-time

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Larry Rosenman
--On Wednesday, May 12, 2004 16:00:48 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: Larry Rosenman <[EMAIL PROTECTED]> writes: --On Wednesday, May 12, 2004 15:39:54 -0400 Tom Lane <[EMAIL PROTECTED]>=20 wrote: At this point I'd settle for saying that --enable-thread-safety on Unixware will generate

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Tom Lane
Larry Rosenman <[EMAIL PROTECTED]> writes: > --On Wednesday, May 12, 2004 15:39:54 -0400 Tom Lane <[EMAIL PROTECTED]>=20 > wrote: >> At this point I'd settle for saying that --enable-thread-safety on >> Unixware will generate a library that requires -Kpthread. This is >> kinda grungy but it seems

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Marc G. Fournier
On Wed, 12 May 2004, Larry Rosenman wrote: > > > --On Wednesday, May 12, 2004 15:59:19 -0300 "Marc G. Fournier" > <[EMAIL PROTECTED]> wrote: > > > On Wed, 12 May 2004, Larry Rosenman wrote: > > > >> >> > Ummm, shouldn't that be added to the port specific Makefile? > >> >> See my reply to Tom. It

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Tom Lane
Larry Rosenman <[EMAIL PROTECTED]> writes: > This is the whole discussion we had back in January/February about forcing > -Kpthread for *ALL* libpq using programs, or dynamically determining > if the image already is linked -Kpthread, or not supporting threads > at all on UW. Oh, that business :-(

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Larry Rosenman
--On Wednesday, May 12, 2004 15:39:54 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: Larry Rosenman <[EMAIL PROTECTED]> writes: This is the whole discussion we had back in January/February about forcing -Kpthread for *ALL* libpq using programs, or dynamically determining if the image already is link

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Marc G. Fournier
On Wed, 12 May 2004, Larry Rosenman wrote: > >> > Ummm, shouldn't that be added to the port specific Makefile? > >> See my reply to Tom. It forces ALL libpq using programs to be > >> linked with -Kpthread, which was deemed unacceptable. > > > > deemed unacceptable by whom? Sounds to me alot simp

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Larry Rosenman
--On Wednesday, May 12, 2004 15:59:19 -0300 "Marc G. Fournier" <[EMAIL PROTECTED]> wrote: On Wed, 12 May 2004, Larry Rosenman wrote: >> > Ummm, shouldn't that be added to the port specific Makefile? >> See my reply to Tom. It forces ALL libpq using programs to be >> linked with -Kpthread, whi

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Marc G. Fournier
On Wed, 12 May 2004, Larry Rosenman wrote: > > > --On Wednesday, May 12, 2004 15:02:30 -0300 "Marc G. Fournier" > <[EMAIL PROTECTED]> wrote: > > > On Wed, 12 May 2004, Larry Rosenman wrote: > > > >> > >> > >> --On Wednesday, May 12, 2004 14:14:30 -0300 "Marc G. Fournier" > >> <[EMAIL PROTECTED]> w

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Larry Rosenman
--On Wednesday, May 12, 2004 15:39:34 -0300 "Marc G. Fournier" <[EMAIL PROTECTED]> wrote: On Wed, 12 May 2004, Larry Rosenman wrote: --On Wednesday, May 12, 2004 15:02:30 -0300 "Marc G. Fournier" <[EMAIL PROTECTED]> wrote: > On Wed, 12 May 2004, Larry Rosenman wrote: > >> >> >> --On Wednesda

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Larry Rosenman
--On Wednesday, May 12, 2004 15:02:30 -0300 "Marc G. Fournier" <[EMAIL PROTECTED]> wrote: On Wed, 12 May 2004, Larry Rosenman wrote: --On Wednesday, May 12, 2004 14:14:30 -0300 "Marc G. Fournier" <[EMAIL PROTECTED]> wrote: > On Wed, 12 May 2004, Larry Rosenman wrote: > >> I'd LIKE to be able

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Marc G. Fournier
On Wed, 12 May 2004, Larry Rosenman wrote: > > > --On Wednesday, May 12, 2004 14:14:30 -0300 "Marc G. Fournier" > <[EMAIL PROTECTED]> wrote: > > > On Wed, 12 May 2004, Larry Rosenman wrote: > > > >> I'd LIKE to be able to have PG wrappers for those functions, and have > >> the first invocation of

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Larry Rosenman
--On Wednesday, May 12, 2004 13:18:35 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: Larry Rosenman <[EMAIL PROTECTED]> writes: --On Wednesday, May 12, 2004 12:58:58 -0400 Tom Lane <[EMAIL PROTECTED]> In what way does the current thread stuff not work for you? In the initdb compile: Undefined

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Marc G. Fournier
On Wed, 12 May 2004, Larry Rosenman wrote: > I'd LIKE to be able to have PG wrappers for those functions, and have > the first invocation of them look via dlsym() for the real ones, and if > they are NOT there, use fake functions that assume we are NOT threaded. Wouldn't it be easier to have a #d

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Larry Rosenman
--On Wednesday, May 12, 2004 14:14:30 -0300 "Marc G. Fournier" <[EMAIL PROTECTED]> wrote: On Wed, 12 May 2004, Larry Rosenman wrote: I'd LIKE to be able to have PG wrappers for those functions, and have the first invocation of them look via dlsym() for the real ones, and if they are NOT there,

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Tom Lane
Larry Rosenman <[EMAIL PROTECTED]> writes: > --On Wednesday, May 12, 2004 12:58:58 -0400 Tom Lane <[EMAIL PROTECTED]> >> In what way does the current thread stuff not work for you? > In the initdb compile: > Undefined first referenced > symbol i

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Tom Lane
Larry Rosenman <[EMAIL PROTECTED]> writes: > At the risk of getting my butt kicked again, is there any way we can > talk about how to deal with threads on UnixWare and the libpq stuff? In what way does the current thread stuff not work for you? regards, tom lane -

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Larry Rosenman
--On Wednesday, May 12, 2004 12:58:58 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: Larry Rosenman <[EMAIL PROTECTED]> writes: At the risk of getting my butt kicked again, is there any way we can talk about how to deal with threads on UnixWare and the libpq stuff? In what way does the current threa

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Larry Rosenman
--On Wednesday, May 12, 2004 12:57:10 -0300 "Marc G. Fournier" <[EMAIL PROTECTED]> wrote: On Wed, 12 May 2004, Larry Rosenman wrote: At the risk of getting my butt kicked again, is there any way we can talk about how to deal with threads on UnixWare and the libpq stuff? Has any other platform

Re: [HACKERS] threads stuff/UnixWare

2004-05-12 Thread Marc G. Fournier
On Wed, 12 May 2004, Larry Rosenman wrote: > At the risk of getting my butt kicked again, is there any way we can > talk about how to deal with threads on UnixWare and the libpq stuff? > > Has any other platform come up with a need to look for the real pthread_* > calls from libpq? > > I would REA

[HACKERS] threads stuff/UnixWare

2004-05-12 Thread Larry Rosenman
At the risk of getting my butt kicked again, is there any way we can talk about how to deal with threads on UnixWare and the libpq stuff? Has any other platform come up with a need to look for the real pthread_* calls from libpq? I would REALLY like us to support threaded programs in UnixWare, an

Re: [HACKERS] Threads vs Processes

2003-09-26 Thread Christopher Kings-Lynne
> > We really don't need threads to replace existing functionality. That > > would be dog work. > > No, that's not the point at all. The problem we are facing at the > moment with the Windows port is lack of fork(), which means there's > no way for separate-subprocess backends to inherit variable

Re: [HACKERS] Threads vs Processes

2003-09-26 Thread Dann Corbit
> -Original Message- > From: Tom Lane [mailto:[EMAIL PROTECTED] > Sent: Friday, September 26, 2003 9:27 AM > To: Bruce Momjian > Cc: Shridhar Daithankar; [EMAIL PROTECTED]; > [EMAIL PROTECTED] > Subject: Re: [HACKERS] Threads vs Processes > > > Bruce Momj

Re: [HACKERS] Threads vs Processes

2003-09-26 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > One solution is for me to continue with this in the Win32 CVS version > > until I have fork/exec() working on Unix, then test on Win32. I think > > that could be done in a few weeks, if not less. > > > Another solution, already menti

Re: [HACKERS] Threads vs Processes

2003-09-26 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > One solution is for me to continue with this in the Win32 CVS version > until I have fork/exec() working on Unix, then test on Win32. I think > that could be done in a few weeks, if not less. > Another solution, already mentioned, is to use threads and

Re: [HACKERS] Threads vs Processes

2003-09-26 Thread Bruce Momjian
Tom Lane wrote: > Shridhar Daithankar <[EMAIL PROTECTED]> writes: > > We really don't need threads to replace existing functionality. That > > would be dog work. > > No, that's not the point at all. The problem we are facing at the > moment with the Windows port is lack of fork(), which means the

Re: [pgsql-hackers-win32] [HACKERS] Threads vs Processes

2003-09-26 Thread Andreas Pflug
Tom Lane wrote: "Merlin Moncure" <[EMAIL PROTECTED]> writes: Tom Lane wrote: Surely the addresses can be assumed constant within a thread. Otherwise we have a problem here too. Quoting from the MSDN: The address of a thread local object is not considered constant, and any express

Re: [HACKERS] Threads vs Processes

2003-09-26 Thread Shridhar Daithankar
On Friday 26 September 2003 20:19, Tom Lane wrote: > Shridhar Daithankar <[EMAIL PROTECTED]> writes: > > We really don't need threads to replace existing functionality. That > > would be dog work. > > No, that's not the point at all. The problem we are facing at the > moment with the Windows port

Re: [HACKERS] Threads vs Processes

2003-09-26 Thread Tom Lane
Shridhar Daithankar <[EMAIL PROTECTED]> writes: > We really don't need threads to replace existing functionality. That > would be dog work. No, that's not the point at all. The problem we are facing at the moment with the Windows port is lack of fork(), which means there's no way for separate-sub

Re: [pgsql-hackers-win32] [HACKERS] Threads vs Processes

2003-09-26 Thread Tom Lane
"Merlin Moncure" <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Surely the addresses can be assumed constant within a thread. >> Otherwise we have a problem here too. > Quoting from the MSDN: > The address of a thread local object is not considered constant, and any > expression involving such a

Re: [HACKERS] Threads vs Processes

2003-09-26 Thread Shridhar Daithankar
Tom Lane wrote: Shridhar Daithankar <[EMAIL PROTECTED]> writes: One thing that can be done is to arrange all globals/statics in a structure and make that structure thread local. That's about as far from "non-invasive" as I can imagine :-( I know. I have following half baked solution. Obviously

Re: [pgsql-hackers-win32] [HACKERS] Threads vs Processes

2003-09-26 Thread Merlin Moncure
Tom Lane wrote: "Merlin Moncure" <[EMAIL PROTECTED]> writes: >> All TLS variables *must* be static (or implicitly static >> through extern, i.e. no 'auto' variables) >I assume you mean static as in not-auto, rather than static as in >not-global. Otherwise we have a problem here. Yes, you are cor

Re: [HACKERS] Threads vs Processes

2003-09-26 Thread Zeugswetter Andreas SB SD
> "When the address-of operator is applied to a thread-local variable, it > is evaluated at run-time and returns the address of the current thread's > instance of that variable. An address so obtained may be used by any > thread. When a thread terminates, any pointers to thread-local variables

Re: [HACKERS] Threads vs Processes

2003-09-25 Thread Claudio Natoli
> Another option would be to create thread local hashtable or other lookup > structure to which you would register a structure for a particular .c > file or group of files. > > You could then define the structures you need locally without > affecting other parts of the codebase. > > > > Myr

Re: [HACKERS] Threads vs Processes

2003-09-25 Thread Kurt at DBC
Tom Lane wrote: I assume you mean static as in not-auto, rather than static as in not-global. Otherwise we have a problem here. [...] Surely the addresses can be assumed constant within a thread. Otherwise we have a problem here too. [...] Taking addresses of TLS variables should be considered il

Re: [HACKERS] Threads vs Processes

2003-09-25 Thread Tom Lane
"Merlin Moncure" <[EMAIL PROTECTED]> writes: > All TLS variables *must* be static (or implicitly static > through extern, i.e. no 'auto' variables) I assume you mean static as in not-auto, rather than static as in not-global. Otherwise we have a problem here. > and their addresses can not be > a

Re: [HACKERS] Threads vs Processes

2003-09-25 Thread Myron Scott
On Thursday, September 25, 2003, at 10:03 AM, Tom Lane wrote: Shridhar Daithankar <[EMAIL PROTECTED]> writes: One thing that can be done is to arrange all globals/statics in a structure and make that structure thread local. That's about as far from "non-invasive" as I can imagine :-( I really, re

Re: [HACKERS] Threads vs Processes

2003-09-25 Thread Keith Bottner
] [mailto:[EMAIL PROTECTED] On Behalf Of Merlin Moncure Sent: Thursday, September 25, 2003 2:49 PM To: Tom Lane Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; Bruce Momjian; Shridhar Daithankar; Claudio Natoli Subject: Re: [HACKERS] Threads vs Processes Both Microsoft and windows compilers support thread

Re: [HACKERS] Threads vs Processes

2003-09-25 Thread Merlin Moncure
Both Microsoft and windows compilers support thread local storage. *If* you guys go with the threading model and *if* it does not introduce any serious portability issues with gcc (big ifs, and I'm not familiar with gcc), than IMO TLS is really the way to go. I don't think any reorganization of p

Re: [HACKERS] Threads vs Processes (was: NuSphere and PostgreSQL for windows)

2003-09-25 Thread Keith Bottner
helps. Keith -Original Message- From: Bruce Momjian [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 11:57 AM To: Keith Bottner Cc: 'Tom Lane'; 'Claudio Natoli'; 'Robert Treat'; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [HACKERS] Thre

Re: [HACKERS] Threads vs Processes

2003-09-25 Thread Tom Lane
Shridhar Daithankar <[EMAIL PROTECTED]> writes: > One thing that can be done is to arrange all globals/statics in a > structure and make that structure thread local. That's about as far from "non-invasive" as I can imagine :-( I really, really want to avoid doing anything like the above, because

Re: [HACKERS] Threads vs Processes (was: NuSphere and PostgreSQL for

2003-09-25 Thread Bruce Momjian
Keith Bottner wrote: > Typically variables that you want to be per-thread are stored in what > Microsoft calls Thread Local Storage (TLS). Variables that you want shared > you can just treat as globals and statics with the appropriate threading > synchronization primitives. With Windows 2000 and la

Re: [HACKERS] Threads vs Processes (was: NuSphere and PostgreSQL for windows)

2003-09-25 Thread Keith Bottner
Momjian; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [HACKERS] Threads vs Processes (was: NuSphere and PostgreSQL for windows) Claudio Natoli <[EMAIL PROTECTED]> writes: > FWIW, I've got a threaded version of the WIN32_DEV branch more or less > "running" (it is

Re: [HACKERS] Threads vs Processes (was: NuSphere and PostgreSQL

2003-09-25 Thread Manfred Spraul
Tom Lane wrote: Claudio Natoli <[EMAIL PROTECTED]> writes: How are you dealing with the issue of wanting some static variables to be per-thread and others not? To be perfectly honest, I'm still trying to familiarize myself with the code sufficiently well so that I can tell which varia

Re: [HACKERS] Threads vs Processes

2003-09-25 Thread Shridhar Daithankar
Tom Lane wrote: Claudio Natoli <[EMAIL PROTECTED]> writes: How are you dealing with the issue of wanting some static variables to be per-thread and others not? To be perfectly honest, I'm still trying to familiarize myself with the code sufficiently well so that I can tell which variables need

Re: [HACKERS] Threads vs Processes (was: NuSphere and PostgreSQL for window s)

2003-09-25 Thread Tom Lane
Claudio Natoli <[EMAIL PROTECTED]> writes: >> How are you dealing with the issue of wanting some static variables to >> be per-thread and others not? > To be perfectly honest, I'm still trying to familiarize myself with the code > sufficiently well so that I can tell which variables need to be per

Re: [HACKERS] Threads vs Processes (was: NuSphere and PostgreSQL for window

2003-09-25 Thread Claudio Natoli
> Claudio Natoli <[EMAIL PROTECTED]> writes: > > FWIW, I've got a threaded version of the WIN32_DEV branch more or less > > "running" (it is a terrible hack job, so NO, no patches... yet :-), as a > > proof of concept. Still a work in progress (ok, I've qualified it enough), > > but it is showing

Re: [HACKERS] Threads vs Processes (was: NuSphere and PostgreSQL for windows)

2003-09-25 Thread Tom Lane
Claudio Natoli <[EMAIL PROTECTED]> writes: > FWIW, I've got a threaded version of the WIN32_DEV branch more or less > "running" (it is a terrible hack job, so NO, no patches... yet :-), as a > proof of concept. Still a work in progress (ok, I've qualified it enough), > but it is showing enough prom

[HACKERS] Threads vs Processes (was: NuSphere and PostgreSQL for windows)

2003-09-25 Thread Claudio Natoli
Tom Lane writes: > BTW, I've been wondering lately if we'd not be better off to look at > using threading in the Windows port, if it'd help us get around the > fork/exec data transfer problem. I'm not sure that it would, > mind you, but if it would give an answer it might be a lot less painful t

Re: [HACKERS] threads/UnixWare

2003-08-14 Thread Lee Kindness
Larry, haven't managed to look at that patch... But stuffed for time just now - just about to head off for the weekend. I'm hoping to spend a bit of time on this on Tuesday! So, i'll see how things have progressed then. L. Larry Rosenman writes: > --On Friday, August 08, 2003 11:53:34 +0100 Lee

Re: [HACKERS] threads/UnixWare

2003-08-14 Thread Larry Rosenman
--On Friday, August 08, 2003 02:10:25 -0400 Bruce Momjian <[EMAIL PROTECTED]> wrote: Actually, your getpwuid_r is the old, pre-POSIX format. The attached email has the configure tests. I was hoping we wouldn't need them, but it seems we may. Err, SCO claims SUSv2, the Single Unix Specificatio

Re: [HACKERS] threads/UnixWare

2003-08-14 Thread Bruce Momjian
Actually, your getpwuid_r is the old, pre-POSIX format. The attached email has the configure tests. I was hoping we wouldn't need them, but it seems we may. --- Larry Rosenman wrote: > In src/port, we have in threads.c: >

Re: [HACKERS] threads/UnixWare

2003-08-11 Thread Bruce Momjian
Of course, I was wrong. In fact, the patch below actually said it was the pre-POSIX version of getpwuid_r(). --- Bruce Momjian wrote: > > Actually, your getpwuid_r is the old, pre-POSIX format. The attached > email has th

Re: [HACKERS] threads/UnixWare

2003-08-10 Thread Lee Kindness
I've not been keeping up with the thread re who has what version of getpwuid_r... But just to clarify things the "right" version is: int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result); documented at: http://www.opengroup.org/onl

Re: [HACKERS] threads/UnixWare

2003-08-08 Thread Larry Rosenman
--On Friday, August 08, 2003 11:53:34 +0100 Lee Kindness <[EMAIL PROTECTED]> wrote: I've not been keeping up with the thread re who has what version of getpwuid_r... But just to clarify things the "right" version is: int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer, s

Re: [HACKERS] threads/UnixWare

2003-08-08 Thread Peter Eisentraut
Bruce Momjian writes: > Actually, your getpwuid_r is the old, pre-POSIX format. No, his is the right POSIX/SUS variant. -- Peter Eisentraut [EMAIL PROTECTED] ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index

[HACKERS] threads/UnixWare

2003-08-07 Thread Larry Rosenman
In src/port, we have in threads.c: /* * Wrapper around getpwuid() or getpwuid_r() to mimic POSIX getpwuid_r() * behaviour, if it is not available. */ int pqGetpwuid(uid_t uid, struct passwd * resultbuf, char *buffer, size_t buflen, struct passwd ** result) { #if defined(USE_THREA

[HACKERS] Threads considerations on UnixWare 7.1.3

2003-07-15 Thread Larry Rosenman
From SCO: We probably want to be aware of this for a threaded libpq for 7.4. LER Forwarded Message Larry Rosenman wrote: identity suppressed for NDA reasons wrote: So, what I was doing was probably screwing up the syscalls that libthread wraps? Or possibly,

Re: [HACKERS] Threads

2003-01-23 Thread mlw
Greg Copeland wrote: On Thu, 2003-01-23 at 09:12, Steve Wampler wrote: On Sat, 4 Jan 2003, Christopher Kings-Lynne wrote: Also remember that in even well developed OS's like FreeBSD, all a process's threads will execute only on one CPU. I doubt that

Re: [HACKERS] Threads

2003-01-23 Thread Greg Copeland
On Thu, 2003-01-23 at 09:12, Steve Wampler wrote: > On Sat, 4 Jan 2003, Christopher Kings-Lynne wrote: > > > > Also remember that in even well developed OS's like FreeBSD, all a > > process's threads will execute only on one CPU. > > I doubt that - it certainly isn't the case on Linux and Solaris

Re: [HACKERS] Threads

2003-01-23 Thread Shridhar Daithankar
On Thursday 23 January 2003 08:42 pm, you wrote: > On Sat, 4 Jan 2003, Christopher Kings-Lynne wrote: > > Also remember that in even well developed OS's like FreeBSD, all a > > process's threads will execute only on one CPU. > > I doubt that - it certainly isn't the case on Linux and Solaris. > A t

Re: [HACKERS] Threads

2003-01-23 Thread Steve Wampler
On Sat, 4 Jan 2003, Christopher Kings-Lynne wrote: > > Also remember that in even well developed OS's like FreeBSD, all a > process's threads will execute only on one CPU. I doubt that - it certainly isn't the case on Linux and Solaris. A thread may *start* execution on the same CPU as it's pare

Re: [HACKERS] Threads

2003-01-23 Thread Curt Sampson
On Sat, 4 Jan 2003, Christopher Kings-Lynne wrote: > Also remember that in even well developed OS's like FreeBSD, all a > process's threads will execute only on one CPU. I would say that that's not terribly well developed. Solaris will split a single processes' threads over multiple CPUs, and I e

Re: [HACKERS] Threads

2003-01-07 Thread Tom Lane
Greg Stark <[EMAIL PROTECTED]> writes: > You missed the point of his post. If one process in your database does > something nasty you damn well should worry about the state of and validity of > the entire database, not just that one backend. Right. And in fact we do blow away all the processes wh

Re: [HACKERS] Threads

2003-01-07 Thread Greg Copeland
On Tue, 2003-01-07 at 12:21, Greg Stark wrote: > Greg Copeland <[EMAIL PROTECTED]> writes: > > > That's the power of using the process model that is currently in use. Should > > it do something naughty, we bitch and complain politely, throw our hands in > > the air and exit. We no longer have to w

Re: [HACKERS] Threads

2003-01-07 Thread Greg Stark
Greg Copeland <[EMAIL PROTECTED]> writes: > That's the power of using the process model that is currently in use. Should > it do something naughty, we bitch and complain politely, throw our hands in > the air and exit. We no longer have to worry about the state and validity of > that backend. Yo

Re: [HACKERS] Threads

2003-01-07 Thread Greg Copeland
On Tue, 2003-01-07 at 02:00, Shridhar Daithankar wrote: > On 6 Jan 2003 at 6:48, Greg Copeland wrote: > > > 1) Get I/O time used fuitfully > > AIO may address this without the need for integrated threading. > > Arguably, from the long thread that last appeared on the topic of AIO, > > some hold th

Re: [HACKERS] Threads

2003-01-07 Thread Shridhar Daithankar
On 6 Jan 2003 at 6:48, Greg Copeland wrote: > > 1) Get I/O time used fuitfully > AIO may address this without the need for integrated threading. > Arguably, from the long thread that last appeared on the topic of AIO, > some hold that AIO doesn't even offer anything beyond the current > implementa

Re: [HACKERS] Threads

2003-01-06 Thread Greg Copeland
On Mon, 2003-01-06 at 05:36, Shridhar Daithankar wrote: > On 6 Jan 2003 at 12:22, Ulrich Neumann wrote: > > > Hello all, > > If someone is interested in the code I can send a zip file to everyone > > who wants. > > I suggest you preserver your work. The reason I suggested thread are mainly two >

Re: [HACKERS] Threads

2003-01-06 Thread Shridhar Daithankar
On 6 Jan 2003 at 12:22, Ulrich Neumann wrote: > Hello all, > If someone is interested in the code I can send a zip file to everyone > who wants. I suggest you preserver your work. The reason I suggested thread are mainly two folds. 1) Get I/O time used fuitfully 2) Use multiple CPU better. It

Re: [HACKERS] Threads

2003-01-06 Thread Ulrich Neumann
Hello all, it's very interesting to see the discussion of "threads" again. I've portet PostgreSQL to a "thread-per-connection" model based on pthreads and it is functional. Most of the work was finding all the static globals in the sourcefiles and swapping them between threads and freeing memory

Re: [HACKERS] Threads

2003-01-05 Thread Sailesh Krishnamurthy
> "Shridhar" == Shridhar Daithankar <[EMAIL PROTECTED]> writes: Shridhar> On Saturday 04 January 2003 03:20 am, you wrote: >> >I am sure, many of you would like to delete this message >> before reading, > hold on. :-) >> >> I'm afraid most posters did not read the message.

Re: [HACKERS] Threads

2003-01-05 Thread Shridhar Daithankar
On Saturday 04 January 2003 03:20 am, you wrote: > >I am sure, many of you would like to delete this message before reading, > > hold on. :-) > > I'm afraid most posters did not read the message. Those who replied > > "Why bother?" did not address your challenge: Our challenges may be..;-) Anyw

Re: [HACKERS] Threads

2003-01-04 Thread Greg Copeland
On Sat, 2003-01-04 at 06:59, Kaare Rasmussen wrote: > > Umm. No. User or system level threads, the statement is true. If a > > thread kills over, the process goes with it. Furthermore, on Win32 > > Hm. This is a database system. If one of the backend processes dies > unexpectedly, I'm not sur

  1   2   >