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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom Lane Sent: Thursday, September 25, 2003 9:17 AM To: Claudio Natoli Cc: Robert Treat; Bruce 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 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 ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html