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 v4] Make bindresvport() function to multithread-safe


On 09/29/2012 01:01 AM, Carlos O'Donell wrote:
> Could you please answer Roland's question here:
> http://sourceware.org/ml/libc-alpha/2012-09/msg00465.html
> "I don't see the rationale for requiring bindresvport to be thread-safe now."
> 

I do not find any rationale for requiring bindresvport to be thread-safe,
but I also can not find any restriction for bindresvport is not used
in multithread circumstance.

> More specifically can you explain *why* you need bindresvport to be
> thread-safe?
> 

When doing multithreaded programming, if misuse an unsafe function,
multithreaded programs may cause serious bug. In order to ensure the 
correctness of multithreaded programs, we want to make unsafe function to
multithread-safeïespecially a function is not specified by POSIX or does
not comply with POSIX.


I will send v5 patch:
  - get_port() is replaced with __get_unique_id().
  - Add new file sysdeps/unix/sysv/linux/bindrsvprt.c and sysdeps/unix/sysv/linux/bindrsvprt.h

Please review, thanks.

-- 
Best Regards,
Peng


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