[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CHLD traps run at the same time

From: Linda Walsh
Subject: Re: CHLD traps run at the same time
Date: Sun, 25 Jan 2015 02:41:08 -0800
User-agent: Thunderbird

Chet Ramey wrote:

It's not a bug.  The only guarantee is that the CHLD trap gets run once for
each child bash reaps.

Bash gets SIGCHLD, reaps as many terminated child processes as it can, then
runs the CHLD trap once for each terminated child when it's no longer in a
signal handler context.  I don't have any plans to change this.

Doesn't bash run off an event loop [yet]?...
Things like that can be check in the event loop periodically
every 100ms or 50ms...  (BASH_SIGHANDLER_POLL_INTERVAL)...

I found in programs that deal with input and need to deal with other
stuff, that I've almost always had to go to some event loop and
the resulting code is usually more efficient (xosview seemed to
drop about 60-70% cpu usage by going to an event loop where it
used to use sleeps and polls)...  But depends on the program,
as far as benefits, as well as how much work...  I only added
about 50k lines of C++ code... really a drop in the bucket.. ;-)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]