> In POSIX, I'm not sure how to do allocation, cleanup, and management
> of TSD. These could be problems, especially for singletons in dlls.
> (Or maybe not. I hope someone else knows.) Otherwise, so long as you
> aren't using very large numbers of singletons and threads, this looks
> like a competitive option.
I would guess you call pthread_key_create in a constructor for a static.
This does feel a bit like you're pushing the problem into creating the
singleton thread-specific data object, which you somehow handle through
other run-time mechanisms.
> > Note that it would be sufficient to have a processor specific flag
> > (instead of thread specific flag) but AFAIK there is no portable
> > way for doing it...
> Right. Maybe we need "CPULocals" in Java.
Does that really buy you performance at user level? Unlike thread locals,
the semantics of "CPULocals" seem nontrivial, since you can ge preempted
halfway through an update ...
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel
This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:30 EDT