This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] Make bindresvport() function to multithread-safe


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]