Re: Threads vs Processes - Mailing list pgsql-hackers

From Zeugswetter Andreas SB SD
Subject Re: Threads vs Processes
Date
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA4962017@m0114.s-mxs.net
Whole thread Raw
List pgsql-hackers
> "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
> in that thread become invalid."

Bummer, I would have thought one advantage of using TLS must surely be memory
protection ? So the only for pg useful usage for TLS seems to be "__declspec(thread)"
and "__declspec(thread) static" (both for stuff that do not need runtime
preinitialization).

Maybe the techniques of electric fence could be used for protecting the shmem
at least a little bit.

Andreas

pgsql-hackers by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: pg_get_triggerdef pretty printing
Next
From: Andreas Pflug
Date:
Subject: Re: pg_get_triggerdef pretty printing