Re: Threads vs Processes (was: NuSphere and PostgreSQL for windows) - Mailing list pgsql-hackers

From Keith Bottner
Subject Re: Threads vs Processes (was: NuSphere and PostgreSQL for windows)
Date
Msg-id 001c01c38385$1d9021e0$7d00a8c0@juxtapose
Whole thread Raw
In response to Re: Threads vs Processes (was: NuSphere and PostgreSQL for windows)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Threads vs Processes (was: NuSphere and PostgreSQL for  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
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.

Keith

-----Original Message-----
From: pgsql-hackers-owner@postgresql.org
[mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Tom Lane
Sent: Thursday, September 25, 2003 9:17 AM
To: Claudio Natoli
Cc: Robert Treat; Bruce Momjian; pgsql-hackers@postgresql.org;
pgsql-hackers-win32@postgresql.org
Subject: Re: [HACKERS] Threads vs Processes (was: NuSphere and PostgreSQL
for windows)


Claudio Natoli <claudio.natoli@memetrics.com> 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 promise to convince me that
> threading is the way to go for the Win32 port.

How are you dealing with the issue of wanting some static variables to be
per-thread and others not?

            regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


pgsql-hackers by date:

Previous
From: markw@osdl.org
Date:
Subject: Re: More Prelimiary DBT-2 Test Results with PostgreSQL
Next
From: Zhen Yang
Date:
Subject: Re: Question on adding new indexes to Postgresql