This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] Make bindresvport() function to multithread-safe
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: Peng Haitao <penght at cn dot fujitsu dot com>
- Cc: vapier at gentoo dot org, libc-alpha at sourceware dot org
- Date: Wed, 19 Sep 2012 02:56:08 -0400
- Subject: Re: [PATCH v2] Make bindresvport() function to multithread-safe
- References: <1348019109-23363-1-git-send-email-penght@cn.fujitsu.com>
On Tue, Sep 18, 2012 at 9:45 PM, Peng Haitao <penght@cn.fujitsu.com> wrote:
> bindresvport() uses two static variables port and startport which are not
> protected. It is not safe when in multithread circumstance.
>
> bindresvport() select a port number from the range 512 to 1023, when in
> multithread circumstance, the port may be 1024. So the static variables will be
> protected.
This patch is unacceptable for two reasons:
(a) We define bindresvport() as non-thread-safe. Therefore the change
is not required.
and
(b) Adding locking to bindresvport() will only slow down the fast path
in the function.
You have provided no rationale for the change.
Until you provide some rationale, or prove that performance doesn't
matter in the case of this function, the change is unacceptable.
Does that make sense?
Cheers,
Carlos.