jlaitine commented on issue #16935:
URL: https://github.com/apache/nuttx/issues/16935#issuecomment-3245605829

   > From my limited understanding of the POSIX spec, it seems that the thread 
that handles an external signal (e.g. from `kill`) is intended to be arbitrary 
in general. It's the. Up to get program to mask or direct the signal from 
there. To me, this seems like the right response to a keyboard interrupt (or in 
this case from the tty serial driver).
   > 
   > Perhaps the goal was to have it be more predictable in that the main 
thread of a process would always receive it instead of an arbitrary one?
   > 
   > It's also strange that `nxsig_tgkill()` doesn't seem to be used elsewhere 
(unless my GitHub search results are lying).
   
   Yes, sending signals like ctrl+c to a specific thread is (imho) wrong; 
imagine e.g. a case where process' main thread creates worker threads, and 
joins them (wait until they exit). This is not uncommon, and sending a signal 
to the main thread only leads (probably?) to signal delivery only when the 
process is exiting for some other reason (main thread gets to run again).
   
   Those signals should always be delivered to group, not to a specific thread.
   
   Thats why I don't understand the PR #14104 - it is not strictly against 
posix, imho, because signal *may* be handled by any thread within the process. 
But I think it is still wrong...
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to