signal not received

This is a discussion on signal not received within the C Programming forums, part of the General Programming Boards category; Hi, does anyone know any problems with signals being sent successfull but not being received? I am using signal (SIGUSR1, ...

  1. #1
    Its me!
    Guest

    Question signal not received

    Hi,

    does anyone know any problems with signals being sent successfull but not being received?

    I am using signal (SIGUSR1, handler); to trap signals.

    I am raising a signal using kill(SIGINT, pid);

    The kill command returns a 0 meaning it is successful, but the handler never receives it.

    This happens when a lot of signals are sent to a lot of processes in a short time frame.

    Thanks for help....


  2. #2
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Either try the Linux board if you are using Linux, or else for Microsoft this involves Win32 and is designated for the Windows Programming Board.

  3. #3
    Its me
    Guest
    I am using solaris 5.8 and using the gnu C compiler....

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,541
    > This happens when a lot of signals are sent to a lot of processes in a short time frame.
    I'd say this is the problem. Signals are exceptions, not a means of communication between processes. In particular, each process doesn't have an infinitely deep queue of pending signals.

    Some signal handlers reset to default behaviour when they are triggered (default being to ignore).

    You need to read up in depth on how signals are handled.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User Engineer's Avatar
    Join Date
    Oct 2001
    Posts
    125
    It happens because you are trapping SIGUSR1 and everything in your signal handler will occur only when SIGUSR1 is raised. But you are in fact raising SIGINT ( which is a completely different signal). Try to do:

    signal( A, handler); and kill( A, pid );

    what you are doing now is:

    signal( A, handler); and kill( B, pid );

    Hope I explained it well enough.
    1 rule of the Samurai Code: if you have nothing to say, don't say anything at all!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 10-15-2008, 09:24 AM
  2. WSAGetLastError() is returning 0
    By 39ster in forum Networking/Device Communication
    Replies: 2
    Last Post: 07-16-2008, 06:57 AM
  3. Signal and exception handling
    By nts in forum C++ Programming
    Replies: 23
    Last Post: 11-15-2007, 01:36 PM
  4. socket question
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 07-19-2002, 01:54 PM
  5. signal handling
    By trekker in forum C Programming
    Replies: 2
    Last Post: 07-05-2002, 02:52 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21