Thread Local Storage
- Posted by petelomax Jan 25, 2013
- 1733 views
I'm going to be out of town/offline for about 10 days, but I was about to wrap TLSAlloc/TlsSetValue/TlsGetValue/TlsFree. I thought I'd be cheeky and ask if anyone else wanted a bash, as it will eventually be needed. As I understand it, TLSAlloc creates an index to be used by all threads, so can be stored in shared/static memory, say it returns 7. Then TlsSet/GetValue(7) will set/get different things for each thread, and TlsFree(7) should not be called until all threads are finished. The first stab should NOT need threads, just show that it works like normal storage. Should not be difficult at all.
Intro and more specifically
See you all again sometime next week,
Pete