[M3devel] Per thread data

Dragiša Durić dragisha at m3w.org
Tue Sep 14 06:57:33 CEST 2010


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