[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)



[GNUS seems to have botched the encoding of my first reply.  Let me
try again.]

<dragisha ho com> writes:
> > 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]