🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2
Article #935

Per thread global data

#935
From: Harry Barman
Date: Thu, 14 Dec 1989 15:32
19 lines
1124 bytes
Hi,

I'm looking for a means of keeping a piece of data associated with a thread.

I'm using large model Microsoft C,  and it seems that global data is 
available to all threads in the process,  and each thread has it's own stack.
What I want to do is to have some data that is global to the *thread* that can
be accessed by any procedure executed in the thread.

Anyone know any (cheap) ways to do this??

My last resort is to allocate a memory area for each thread,  and have a little
table that keeps track of which area corresponds to which thread.  The trouble
with this is that doing the table look up is kinda expensive,  I'd much prefer
to somehow add the memory area pointer to the thread's context.

Cheers,

Harry
Technical Details
Message-ID: <14570003@otter.hpl.hp.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!helios.ee.lbl.gov!ucsd!ucsdhub!hp-sdd!hplabs!otter!hjb

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!helios.ee.lbl.gov!ucsd!ucsdhub!hp-sdd!hplabs!otter!hjb
From: hjb@otter.hpl.hp.com (Harry Barman)
Newsgroups: comp.os.os2
Subject: Per thread global data
Message-ID: <14570003@otter.hpl.hp.com>
Date: 14 Dec 89 15:32:58 GMT
Organization: Hewlett-Packard Laboratories, Bristol, UK.
Lines: 19