apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: svn commit: r1797422 - /apr/apr/trunk/memcache/apr_memcache.c
Date Mon, 05 Jun 2017 21:13:57 GMT
On Mon, Jun 5, 2017 at 10:32 PM, William A Rowe Jr <wrowe@rowe-clan.net> wrote:
> What happens if two different threads attempt this poll in parallel? I
> presumed pollsets are copied to prevent two threads from clashing.

APR_POLLSET_NOCOPY is about the lifetime of the pollfds, while
thread-safety should be ensured by APR_POLLSET_THREADSAFE (using
no/zero flags as before was actually not thread-safe already).

BTW, if the OS/native pollset is already threadsafe and
APR_POLLSET_NOCOPY is specified, APR_POLLSET_THREADSAFE can sometimes
be omitted/ignored (this the case for e.g. epoll, but not for kqueue
whereas it possibly could be).
Hence if we really need to be thread-safe here we should use
APR_POLLSET_THREADSAFE explicitely.

Mime
View raw message