[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 ■aa Duri ■ <dragisha ho com> writes:
>  ■0=0  ■=54, 21-12-2003  ■C 01:53, Jim Blandy  ■X5  ■=0?8A0>:
> > My __thread structure contains the links of the list of threads to
> > send signals to.  Both adding threads to the list and traversing the
> > list sending signals require code to hold the same mutex.  So I have
> > always referenced my thread structure before using it in the signal
> > handler.  And I don't make any first references to TLS in my signal
> > handlers.  So it sounds like I'm okay.
> 
>   But, you referenced TLS variable in another thread? Signal handler for
> every thread happens in it's thread so you have now reference when your
> signal handler asks for that ("same") variable.

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.




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