This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: Signal handling tune up.
- From: Christopher Faylor <cgf at redhat dot com>
- To: cygwin-patches at cygwin dot com
- Date: Mon, 18 Aug 2003 20:34:38 -0400
- Subject: Re: Signal handling tune up.
- References: <3.0.5.32.20030818201736.0080e4e0@mail.attbi.com>
- Reply-to: cygwin-patches at cygwin dot com
On Mon, Aug 18, 2003 at 08:17:36PM -0400, Pierre A. Humblet wrote:
>During my work on using the multimedia timer for setitimer I noticed
>that Cygwin was not optimized to handle 1000 signals per second.
>It starts trashing under heavy load. Attached is a tune up patch.
>It also modestly improves performances at light load and fixes a
>race condition.
>
>Some explanations are in order, here they are.
I will break down your patch and apply what I think is appropriate but
I would appreciate one patch/one bug in the future.
For now, I've applied this:
>*********************************************************************
>2)
> movl $0,%0 # zero the signal number as a \n\
> # flag to the signal handler thread\n\
> # that it is ok to set up sigsave\n\
> \n\
> call _set_process_mask@4
>There is a race where the sigthread can start a handler for a signal that
>should be blocked.
>Simply interchanging the order still allows the sigthread to try to launch
>a handler (before the mask is set), discovers that sigsave is busy and takes
>cumbersome actions (e.g. Sleep).
>The patch moves set_process_mask all the way up to interrupt_setup(), so
>it is set in the sigthread itself.
cgf