Thread: Signal Handling program

  1. #1
    langdoy
    Guest

    Signal Handling program

    Need help with this program. Need to create a generic signal handler. Pgrogram hass to count the number of signals generated in a specific time period. The time interval, in milliseconds, is to be entered from the command line. In addition to catching CTRL-C from the keyboard, I have to define and count two additional user defined signals created from either the same or a child process. In addition to the time interval on the command line, input the number of processes to be created ( >0 ) in a chain structure. Each child process must generate each signal a random number of times.

    After time elapsed, print out:

    1. the number and type of all signals detected by each parent process ( 10 points )

    2. the process-id, parent process-id and creation time of all processes created ( 10 points )

    3. the user, real, and system time for each process created. (10 points ).

    I don't know how to access the system for the timing and run the loop within that time. If anyone can help me with some section coding or an example or some links. Thanks

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    What have you done so far? Such as research into signals, signal handling and actual code attempts.

    -Prelude
    My best code is written with the delete key.

  3. #3
    langdoy
    Guest
    I've looked into signals and understand all the concepts. I know of the signals Cntrl-C, Cntrl-Z, kill command, and kill() within other processes, and i think pg. I know how it works, but really dont' know what to do when it gets to the implementation. Don't know where to start and finish. So basically....I have nothing.

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Take a look at this for more information on the actual implementation. But you want to be careful when working with signals, it's very easy to screw up.

    -Prelude
    My best code is written with the delete key.

  5. #5
    langdoy
    Guest
    Thanks Prelude...I hope it helps

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. signal handling and exception handling
    By lehe in forum C++ Programming
    Replies: 2
    Last Post: 06-15-2009, 10:01 PM
  2. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 07:51 AM
  3. Signal handling
    By quagsire in forum Linux Programming
    Replies: 1
    Last Post: 07-08-2002, 07:54 AM
  4. signal handling
    By trekker in forum C Programming
    Replies: 2
    Last Post: 07-05-2002, 02:52 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM