Thread: signal sending and waiting

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    9

    signal sending and waiting

    Hey all

    we have a program that is supposed to fork to children, and each child calls a program which is supposed to send 100 signals to the other child process

    now we have these programs sending signals, and we catch teh signals, and in the end we are supposed to time how long this takes

    now when our program sends 100 signals, it kills each process and nothing happens afterwards, there is supposed to be a way to block and handle these signals as they come in, they way i get it is its sending lots of signals and i guess we are not waiting before it is received before the next one is sent out (if that makes any sense)

    basically, we read about masks, and sigsuspend, and tried some stuff but no luck

    Code:
    sigset_t mask, oldmask;
    ...
    
    sigemptyset(&mask);
    sigaddset(&mask, SIGUSR1);
    
    sigprocmask (SIG_BLOCK, &mask, &oldmask);
    				while(***what goes here??***)
    						{
    							sigsuspend(&oldmask);
    						}
    				sigprocmask (SIG_UNBLOCK, &mask, NULL);
    now i got thsi example from elsewhere in this forum, in the while loop condition before the sig suspend, it said (!usr_interrupt), which they said waits for a user interrupt, how do we make a condition that says to wait for a signal interrupt, i think that may be our problem, any suggestions are appreciate, thanks!!!!

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    sigpending()? Its been a while... I can get back to this a little later, but meanwhile I believe Salem or laser or who ever should move this to the linux forum so you may get more immediate results.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Qusetion about sending VK_CONTROL
    By tjpanda in forum Windows Programming
    Replies: 4
    Last Post: 12-04-2008, 01:06 PM
  2. signal sending and waiting
    By eva69 in forum Linux Programming
    Replies: 1
    Last Post: 10-03-2008, 05:07 PM
  3. Sending structures through the network
    By Mortissus in forum C Programming
    Replies: 3
    Last Post: 07-26-2007, 10:24 AM
  4. Where's the EPIPE signal?
    By marc.andrysco in forum Networking/Device Communication
    Replies: 0
    Last Post: 12-23-2006, 08:04 PM