[M3devel] Per thread data

Darko darko at darko.org
Tue Sep 14 07:08:19 CEST 2010


I'm guessing that the pthread calls wouldn't be portable to Win32? Which is ok if there are similar calls for Win threads.


On 13/09/2010, at 9:57 PM, Dragiša Durić wrote:

> Only "better" would be using same storage as for MyId... Access time
> would be same as for that value, and if you use MyId access time is
> access to TLS (thread local storage) plus your structure manipulation.
> IMO, some IntRefTbl is better idea than list.
> 
> If you decide to use same storage, then it's pthread.getspecific and
> pthread.setspecific you are looking for.
> 
> On Mon, 2010-09-13 at 21:14 -0700, Darko wrote:
>> I need to have certain data structures allocated on a per thread basis. Right now I'm thinking of using the thread id from ThreadF.MyId() to index a list. Is there a better, more portable way of allocating on a per-thread basis?
>> 
>> Cheers,
>> Darko.
>> 
> 
> -- 
> Dragiša Durić <dragisha at m3w.org>
> 




More information about the M3devel mailing list