Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Use of signal() in nw_pthreads: (6 Items)
   
Use of signal() in nw_pthreads  
While trying to learn how to build a removable lsm (which turned into learning how to build a removable driver), I 
noticed that each instance of nw_pthread_create() calls signal() to establish a signal handler for the signal dropped by
 the quiesce_callout().  But there is only one signal handler per process, so the last call to nw_pthread_create sets 
the signal handler for all the threads!  And the signal handler in ppp_tty.c uses wtp->wt_specialized in a much 
different manner than the signal handlers in qnet or drivertest.  So it appears that if both qnet and ppp are loaded, 
there are threads that will not be quiesced by quiese_all().  What am I missing here?

Murf
Re: Use of signal() in nw_pthreads  
On Tue, Nov 11, 2008 at 06:50:20AM -0500, John Murphy wrote:
> While trying to learn how to build a removable lsm (which turned into learning how to build a removable driver), I 
noticed that each instance of nw_pthread_create() calls signal() to establish a signal handler for the signal dropped by
 the quiesce_callout().  But there is only one signal handler per process, so the last call to nw_pthread_create sets 
the signal handler for all the threads!  And the signal handler in ppp_tty.c uses wtp->wt_specialized in a much 
different manner than the signal handlers in qnet or drivertest.  So it appears that if both qnet and ppp are loaded, 
there are threads that will not be quiesced by quiese_all().  What am I missing here?

Yes, that looks like a bug.  I'll make a PR.

Thanks,

-seanb
Re: Use of signal() in nw_pthreads  
Thanks!

Murf
Re: Use of signal() in nw_pthreads  
On Tue, Nov 11, 2008 at 10:16:30AM -0500, John Murphy wrote:
> Thanks!
> 

The ppp side should be fixed.  qnet still to come but
that may get you going...

-seanb
Re: Use of signal() in nw_pthreads  
Thanks!  That wasn't actually giving me any trouble, other than trying to understand why unloading my driver is causing 
io-pkt to crash.

Here's another (only slightly rleated) question.  I have a two lsm's, each of which has a resource manager.  I can 
open() either one of the RM's from a separate app, but neither RM can open the other.  They can, on the other hand, 
open() RM's that are not living in lsm's.  I.e, it's as if an lsm isn't allowed open an RM in another lsm --- does that 
make sense?  Is there such a restriction, or am I overlooking some silly error on my part?

Murf
Re: Use of signal() in nw_pthreads  
Oops!  Both of my lsm's are part of the io-pkt process, so I can't expect my open() to do much.  Amazing how clear 
things become once you write them down....

Murf