Skip site navigation (1) Skip section navigation (2)

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

From: "Keith Bottner" <kbottner(at)comcast(dot)net>
To: "'Bruce Momjian'" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>,"'Claudio Natoli'" <claudio(dot)natoli(at)memetrics(dot)com>,"'Robert Treat'" <xzilla(at)users(dot)sourceforge(dot)net>,<pgsql-hackers(at)postgresql(dot)org>, <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: [HACKERS] Threads vs Processes (was: NuSphere and PostgreSQL for windows)
Date: 2003-09-25 19:16:24
Message-ID: 003301c38399$82fc3eb0$7d00a8c0@juxtapose (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-hackers-win32
I do not know for sure to what extent GCC supports TLS on Windows. There are
compiler extensions that can be used under Windows, like __declspec(thread)
which automagically handles the declaration and initialization of the TLS
variable rather than dynamically calling the TlsAlloc, TlsFree, TlsSetValue,
and TlsGetValue. I also believe they have extensions in the compiler that
recognize that you are using TLS (when using __declspec) and therefore allow
you to access them without having to use the TlsSetValue and TlsGetValue.
Sorry I don't about GCC, but I hope this additional information helps.


-----Original Message-----
From: Bruce Momjian [mailto:pgman(at)candle(dot)pha(dot)pa(dot)us] 
Sent: Thursday, September 25, 2003 11:57 AM
To: Keith Bottner
Cc: 'Tom Lane'; 'Claudio Natoli'; 'Robert Treat';
pgsql-hackers(at)postgresql(dot)org; pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: [HACKERS] Threads vs Processes (was: NuSphere and PostgreSQL
for windows)

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 later you 
> have up to 1088 TLS locations that you can use, of course these can be 
> pointers to memory which can store whatever you want.

Goes GCC on Windows support TLS, or only Microsoft compilers?

  Bruce Momjian                        |
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

pgsql-hackers by date

Next:From: Nigel J. AndrewsDate: 2003-09-25 19:29:54
Subject: Re: pgsql procedures??
Previous:From: Tom LaneDate: 2003-09-25 19:09:15
Subject: Re: invalid tid errors in latest 7.3.4 stable.

pgsql-hackers-win32 by date

Next:From: Merlin MoncureDate: 2003-09-25 19:48:43
Subject: Re: [HACKERS] Threads vs Processes
Previous:From: Cyrille ChepelovDate: 2003-09-25 18:22:18
Subject: Re: [HACKERS] Threads vs Processes (was: NuSphere and PostgreSQL for

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group