Subj : Re: c++ containers in thread-local memory To : comp.programming.threads From : gottlobfrege Date : Fri Feb 25 2005 07:00 am awaken wrote: > I need some list/vector/whatever which keeps thread-local data across > different method calls from one thread to one class instance. > VC++ "magic qualifier" __declspes(thread) doesn't work for STL containers > (or for any objects with constructor) > How to overcome this? > Can custom allocator (using TlsAlloc API) solve this problem? Could you just put a pointer to the container in TLS and create a new container for each thread? ie you don't need each item to be TLS, you just need the method of accessing them be such that each thread sees only its own items, right? Tony .