Re: Design hole in nptl (and more general in POSIX threads)
Dragiša Durić <[email protected]> Mon, 22 Dec 2003 09:42:28 +0100
| Newsgroups | gmane.comp.lib.phil |
|---|---|
| Message-ID | <[email protected]> |
Дана пон, 22-12-2003 у 01:16, Jim Blandy је написао: ... > > When a thread registers itself with the collector, it adds its own > __thread structure to a global linked list. The collecting thread > finds other threads' structures via that global linked list. So > there's no problem there. What I see as "problem" here is: to know how to find whatever thread specific data, runtime must (minimally) use pthread_self() to find for which thread it must lookup; or some data in TLS for same thing. There is no way __thread can pull this out of thin air - so it's no more async safe than safer one of these two methods. Or maybe runtime implements working way for doing this for every target platform and is hiding it from you behind __thread abstraction. Still safer when you know how exactly it works, IMHO. Here is why I think Boehm did it right - nothing too important is hidden behind "expected compiler/runtime behaviour". dd