This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #16996] get_nprocs: Only return explictly set cache values
- From: Meador Inge <meadori at codesourcery dot com>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>, Roland McGrath <roland at hack dot frob dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Wed, 31 Dec 1969 18:06:21 -0600
- Subject: Re: [PATCH][BZ #16996] get_nprocs: Only return explictly set cache values
- Authentication-results: sourceware.org; auth=none
- References: <1402591036-29454-1-git-send-email-meadori at codesourcery dot com> <20140612171519 dot GN10378 at spoyarek dot pnq dot redhat dot com> <539A0BF4 dot 6000603 at codesourcery dot com> <20140612203737 dot 763EC2C39B8 at topped-with-meat dot com> <20140612205413 dot GR10378 at spoyarek dot pnq dot redhat dot com>
On 06/12/2014 03:54 PM, Siddhesh Poyarekar wrote:
> Oh yes, so:
>
> (now == prev && now != 0)
That is indeed simpler and fixes the correctness issue, but now caching is
disabled for the 'time (NULL) == 0' case. Therefore two close call to
'get_nprocs' at that time point will cause the value to be computed both times.
I prefer the first patch where correctness and the caching behavior is
maintained, but I understand if others value the simpler approach that
sacrifices a caching corner-case while still fixing correctness.
--
Meador Inge
CodeSourcery / Mentor Embedded