Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ignoring a signal
#1
is there a way for python to ignore a specific signal (in posix) without setting up a handler? all the google results describe how to handle a signal. i'm expecting a very rapid burst of several signals.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
What about using the handler signal.SIG_IGN?
Reply
#3
the problem with that, as i see it, is that it appears to be a handler, not a symbol. my worry with a handler is how signals get masked. i need to be 100% certain that a flood of signals cannot be a detriment-of-service.

i see that the document you point to refers to it as a special value. i wonder if signal.signal() really calls the old unstable signal() syscall or the new sigaction() syscall. i wonder if i still have any of my very old C code around where i used signal() to see how i handled that. i could not find signal.sigaction() anywhere.

it turns out that GLIBC may influence the behavior of a call to signal(), depending on the definition of _BSD_SOURCE at the C code level (of CPython).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#4
What is the the problem with having a handler? Is it not fast enough?
How many signals do your program receive per microsecond?

If you're flooding your program with signals, then something went wrong.
Better approach is to stop the signal-flooding.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#5
multiple processes may reflect a signal to this one process, concurrently. i have had this issue happen in C, before. i had to get the signal to be ignore to make it work. i have had experience with high signal rates. another solution is signal masks. but i need to call sigaction() for that.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  WARNING: Ignoring invalid distribution kucingkembar 1 24,306 Sep-02-2022, 06:49 AM
Last Post: snippsat
  Ignoring errors when using robjects. Rav013 3 3,022 May-04-2021, 09:05 PM
Last Post: Gribouillis
  Ignoring a list item hank4eva 2 2,067 Aug-17-2020, 08:40 AM
Last Post: perfringo
  Ignoring non characters in a string evans 1 2,617 Mar-11-2018, 09:13 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020