[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Design hole in nptl (and more general in POSIX threads)



Dragiša Durić wrote:
>   What bothers me now is... What procedures in pthread API are async
> safe? Boehm GC uses pthread_self(), as probably you too are using. Is it
> safe to use pthread_key_getspecific()?

Are you sure pthread_self() is async-signal-safe?

According to the Single Unix Specification v3, and my reading of it,
the only thread function which is async-signal-safe is sem_drop().

I wouldn't be surprised if pthread_self() isn't reliable in signal
handlers with the old LinuxThreads library which didn't use a
per-thread segment register on x86.

Thanks,
-- Jamie




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]