problems with real-time POSIX signals

From: aires (barros_aires_at_yahoo.com)
Date: 08/23/04


Date: 23 Aug 2004 06:07:14 -0700

Hi
hope someone can help me here as i can see some Q's but couldnt find
too many helpful answers (atleast for my case).
basically writing a test prog ( for a larger project) to familiarise
myself with usage of the POSIX RT signals (and timers) in linux
(between SIGRTMIN and SIGRTMAX - 32-63). actually using from
SIGRTMIN+3 as LinuxThreads app uses 1st 3. I'm creating child
processes using fork and then sending them RT signals using sigqueue (
had tried using pthreads but that was even worse :-( ).
Problem seems to be with the user responses i expect at certain times
in my main process to make some decisions (send a std or rt signal,
start a new child, etc). My signals reach the correct child and signal
handler is called usually for the first signal i send from main
process. However subsequently my main menu seems to get a bunch of
wrong signals (from wherever - have tried blocking all except the reqd
signals but...) and my main menu goes kaput even to the extent of
generating false user responses and starting new child processes
infinitely ! tried fflush'ing stdout and sync() which seems to have
lessened the false signals but all highly variable.also using
read()/write().
Also similarly when using alarm() and clock_set/gettime() seem to get
false signals all over again.
Have also tried checking for queing of the RT signals using
nanosleep(), usleep() (sleep() app is no-no) but same results.
Have tried specifying _POSIX_C_SOURCE=199506L for posix only but..
Am compiling/testing on a 2.6.5 kernel using gcc2.95.3 (for project
related reasons) with glibc2.3.3

help ! plz

Aires



Relevant Pages

  • [PATCH] utrace: remove indirections
    ... With utrace as the new singing dancing ... typedef struct utrace_get { ... * Called with the siglock held before dequeuing pending signals. ... * from seeing its child in TASK_STOPPED state when it waits with WSTOPPED. ...
    (Linux-Kernel)
  • Re: using fork and wait reliably w/signals
    ... > I don't know what the book says about signals. ... you should wait for the child. ... > the parent process will exit soon anyway, ... If the system is not POSIX compliant, then you can ignore the SIGCHLD ...
    (comp.os.linux.development.system)
  • Re: system(), popen(), and SIGCHLD
    ... >which need to be added to each command line, ... termination of the child created by systemhave all completed by the ... command executed by that shell. ... and should be affected by signals. ...
    (comp.unix.programmer)
  • Re: Executing 2 processes "fork()" alternatively
    ... I want the parent and the child to be executed alternatively. ... One of them is using signals, but they need to be used with great ... The first pipe ...
    (comp.unix.programmer)
  • Re: restarting child processes
    ... > requests(from its clients). ... handles the signals itself. ... Happily, when a child dies for an unhandled signal, ... void install_signal_handlers{ ...
    (comp.unix.programmer)