🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: de.comp.lang.c
Article #10

Re: Where does my thread-local data live ?

#10
From: Stefan Kanthak
Date: Wed, 18 Nov 2026 07:30
21 lines
2382 bytes
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> wrote:
> On 11/17/2026 10:34 PM, Stefan Kanthak wrote:
>> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> wrote:
>> 
>>> What about:
>>>
>>> __declspec(thread) int x;
>> 
>> Take a look at <https://skanthak.hier-im-netz.de/blunder.html#blunder114>
>> as well as <https://skanthak.hier-im-netz.de/msvcrt.html#tls>
> Oh yeah. For DLL's, TlsAlloc and friends are the way to go. Iirc, in 
> DLLMain, set everything up.

OUCH: better crawl from under the rock where you stayed 20+ years!
Windows Vista and later versions of NT support __declspec(thread) in
DLLs, there's no need for TlsAlloc() and friends any more in the first
place.

Stefan
-- 
<https://www.duden.de/rechtschreibung/Kanthaken>
Technical Details
Message-ID: <11djk9l$14kk6$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11da9lq$25qpm$3@raubtier-asyl.eternal-september.org> <11dd5co$32h74$1@dont-email.me> <11dhcb5$bitr$1@raubtier-asyl.eternal-september.org> <11diqca$tdad$3@dont-email.me> <11djha7$13ogp$1@dont-email.me> <11djil6$1432f$2@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: "Stefan Kanthak" <postmaster@[127.0.0.1]>
Newsgroups: de.comp.lang.c
Subject: Re: Where does my thread-local data live ?
Date: Wed, 18 Nov 2026 08:30:43 +0100
Organization: Me, myself & IT
Lines: 21
Message-ID: <11djk9l$14kk6$1@dont-email.me>
References: <11da9lq$25qpm$3@raubtier-asyl.eternal-september.org> <11dd5co$32h74$1@dont-email.me> <11dhcb5$bitr$1@raubtier-asyl.eternal-september.org> <11diqca$tdad$3@dont-email.me> <11djha7$13ogp$1@dont-email.me> <11djil6$1432f$2@dont-email.me>
Reply-To: "Stefan Kanthak" <dont.delete-this.dont.remove-this.nospam@arcor.de>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 18 Nov 2026 07:32:05 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1200774"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18p8kIeVACIWIzMkuu50Tz0yeDPB7DT1cwnsg8cl/aNyw=="; posting-host="14f3d93fba32e477a4f6a2c2dcd9cd0a"
Cancel-Lock: sha1:M3OT0dkI7zuEVFBNM7Xn/OuC0PM= sha256:IE1uTv1MEgoaGP+cohMq2Vj/YTarYOjLmsldRSpWLwI=
	sha1:bEVl0y6Sv0YKSPGcPOQYsBVd3t8= sha256:q0lYBHK+l/Y1ygfrYPjwNRnbx3I0nv2aMCDMFiCtixY=
X-Newsreader: Microsoft Windows Mail 6.0.6002.18197
X-Priority: 3
In-Reply-To: <11djil6$1432f$2@dont-email.me>
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7601.24158