[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Microoptimization of lib/poll.c
From: |
Ralf Wildenhues |
Subject: |
Re: [PATCH] Microoptimization of lib/poll.c |
Date: |
Wed, 6 Aug 2008 12:49:47 +0200 |
User-agent: |
Mutt/1.5.18 (2008-07-02) |
Hi Paolo,
* Paolo Bonzini wrote on Wed, Aug 06, 2008 at 10:28:00AM CEST:
> --- a/lib/poll.c
> +++ b/lib/poll.c
> #ifdef _SC_OPEN_MAX
> - if (nfd > sysconf (_SC_OPEN_MAX))
> + static int sc_open_max = -1;
> +
> + if (nfd < 0
> + || (nfd > sc_open_max
> + && (sc_open_max != -1
> + || nfd > (sc_open_max = sysconf (_SC_OPEN_MAX)))))
Doesn't this make poll non-reentrant?
Are there systems where assigning to an int is not atomic?
Thanks,
Ralf