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

From: "Keith Bottner" <kbottner(at)comcast(dot)net>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "'Claudio Natoli'" <claudio(dot)natoli(at)memetrics(dot)com>
Cc: "'Robert Treat'" <xzilla(at)users(dot)sourceforge(dot)net>, "'Bruce Momjian'" <pgman(at)candle(dot)pha(dot)pa(dot)us>, <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 16:50:24
Message-ID: 001c01c38385$1d9021e0$7d00a8c0@juxtapose
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32

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(at)postgresql(dot)org
[mailto:pgsql-hackers-owner(at)postgresql(dot)org] On Behalf Of Tom Lane
Sent: Thursday, September 25, 2003 9:17 AM
To: Claudio Natoli
Cc: Robert Treat; Bruce Momjian; 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)

Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhen Yang 2003-09-25 16:55:48 Re: Question on adding new indexes to Postgresql
Previous Message markw 2003-09-25 16:21:47 Re: More Prelimiary DBT-2 Test Results with PostgreSQL

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Bruce Momjian 2003-09-25 16:57:09 Re: [HACKERS] Threads vs Processes (was: NuSphere and PostgreSQL for
Previous Message Manfred Spraul 2003-09-25 16:03:00 Re: [HACKERS] Threads vs Processes (was: NuSphere and PostgreSQL