You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jim Jagielski <ji...@jaguNET.com> on 2018/09/17 15:52:27 UTC

Fwd: svn commit: r1841078 - in /apr/apr/trunk: CHANGES apr.dsp atomic/unix/builtins64.c atomic/unix/mutex64.c atomic/win32/apr_atomic64.c include/apr_atomic.h include/arch/unix/apr_arch_atomic.h test/testatomic.c

Would like to also propose for apr-1.7... 

> Begin forwarded message:
> 
> From: jim@apache.org
> Subject: svn commit: r1841078 - in /apr/apr/trunk: CHANGES apr.dsp atomic/unix/builtins64.c atomic/unix/mutex64.c atomic/win32/apr_atomic64.c include/apr_atomic.h include/arch/unix/apr_arch_atomic.h test/testatomic.c
> Date: September 17, 2018 at 11:50:19 AM EDT
> To: commits@apr.apache.org
> Reply-To: dev@apr.apache.org
> 
> Author: jim
> Date: Mon Sep 17 15:50:19 2018
> New Revision: 1841078
> 
> URL: http://svn.apache.org/viewvc?rev=1841078&view=rev
> Log:
> Add in Atomics for 64bit ints
> 


Re: svn commit: r1841078 - in /apr/apr/trunk: CHANGES apr.dsp atomic/unix/builtins64.c atomic/unix/mutex64.c atomic/win32/apr_atomic64.c include/apr_atomic.h include/arch/unix/apr_arch_atomic.h test/testatomic.c

Posted by William A Rowe Jr <wr...@rowe-clan.net>.
On Mon, Sep 17, 2018 at 10:52 AM Jim Jagielski <ji...@jagunet.com> wrote:

> Would like to also propose for apr-1.7...
>
> *Subject: **svn commit: r1841078 - in /apr/apr/trunk: CHANGES apr.dsp
> atomic/unix/builtins64.c atomic/unix/mutex64.c atomic/win32/apr_atomic64.c
> include/apr_atomic.h include/arch/unix/apr_arch_atomic.h test/testatomic.c*
>
>
+1.

Re: svn commit: r1841078 - in /apr/apr/trunk: CHANGES apr.dsp atomic/unix/builtins64.c atomic/unix/mutex64.c atomic/win32/apr_atomic64.c include/apr_atomic.h include/arch/unix/apr_arch_atomic.h test/testatomic.c

Posted by Graham Leggett <mi...@sharp.fm>.
On 17 Sep 2018, at 20:54, Yann Ylavic <yl...@gmail.com> wrote:

> How about 128bit? :p
> 
> There are __int128 (gcc) and _m128 (MSVC) and most 64bit intel/amd
> CPUs support cmpxchg16b.
> Intrinsics work on gcc, and (eg.) _InterlockedCompareExchange128 on Windows.
> 
> This can be very useful to avoid the ABA problem when doing atomics
> with 64bit pointers.
> For instance, MPM event could benefit from that (see PR 62141)...

While we’re here we should do this, +1.

Regards,
Graham
—


Re: svn commit: r1841078 - in /apr/apr/trunk: CHANGES apr.dsp atomic/unix/builtins64.c atomic/unix/mutex64.c atomic/win32/apr_atomic64.c include/apr_atomic.h include/arch/unix/apr_arch_atomic.h test/testatomic.c

Posted by Jim Jagielski <ji...@jaguNET.com>.
Moved from httpd dev (which was moved to BCC)

> On Sep 17, 2018, at 2:54 PM, Yann Ylavic <yl...@gmail.com> wrote:
> 
> On Mon, Sep 17, 2018 at 5:52 PM Jim Jagielski <ji...@jagunet.com> wrote:
>> 
>> Would like to also propose for apr-1.7...
> 
> How about 128bit? :p
> 
> There are __int128 (gcc) and _m128 (MSVC) and most 64bit intel/amd
> CPUs support cmpxchg16b.

The ‘__atomic’ builtins can be used with any integral scalar or pointer type that is 1, 2, 4, or 8 bytes in length. 16-byte integral types are also allowed if ‘__int128’ (see __int128 <https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html#g_t_005f_005fint128>) is supported by the architecture.

This also implies that APR create a 128bit Int type, which we don't (yet).

Bumping to support 64bit was easy and logical.. bumping to 128 requires more legwork and is a bit more "intrusive" ;)

+1 to the theory though.

Re: svn commit: r1841078 - in /apr/apr/trunk: CHANGES apr.dsp atomic/unix/builtins64.c atomic/unix/mutex64.c atomic/win32/apr_atomic64.c include/apr_atomic.h include/arch/unix/apr_arch_atomic.h test/testatomic.c

Posted by Jim Jagielski <ji...@jaguNET.com>.
Moved from httpd dev (which was moved to BCC)

> On Sep 17, 2018, at 2:54 PM, Yann Ylavic <yl...@gmail.com> wrote:
> 
> On Mon, Sep 17, 2018 at 5:52 PM Jim Jagielski <ji...@jagunet.com> wrote:
>> 
>> Would like to also propose for apr-1.7...
> 
> How about 128bit? :p
> 
> There are __int128 (gcc) and _m128 (MSVC) and most 64bit intel/amd
> CPUs support cmpxchg16b.

The ‘__atomic’ builtins can be used with any integral scalar or pointer type that is 1, 2, 4, or 8 bytes in length. 16-byte integral types are also allowed if ‘__int128’ (see __int128 <https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html#g_t_005f_005fint128>) is supported by the architecture.

This also implies that APR create a 128bit Int type, which we don't (yet).

Bumping to support 64bit was easy and logical.. bumping to 128 requires more legwork and is a bit more "intrusive" ;)

+1 to the theory though.

Re: svn commit: r1841078 - in /apr/apr/trunk: CHANGES apr.dsp atomic/unix/builtins64.c atomic/unix/mutex64.c atomic/win32/apr_atomic64.c include/apr_atomic.h include/arch/unix/apr_arch_atomic.h test/testatomic.c

Posted by Yann Ylavic <yl...@gmail.com>.
On Mon, Sep 17, 2018 at 5:52 PM Jim Jagielski <ji...@jagunet.com> wrote:
>
> Would like to also propose for apr-1.7...

How about 128bit? :p

There are __int128 (gcc) and _m128 (MSVC) and most 64bit intel/amd
CPUs support cmpxchg16b.
Intrinsics work on gcc, and (eg.) _InterlockedCompareExchange128 on Windows.

This can be very useful to avoid the ABA problem when doing atomics
with 64bit pointers.
For instance, MPM event could benefit from that (see PR 62141)...

Re: svn commit: r1841078 - in /apr/apr/trunk: CHANGES apr.dsp atomic/unix/builtins64.c atomic/unix/mutex64.c atomic/win32/apr_atomic64.c include/apr_atomic.h include/arch/unix/apr_arch_atomic.h test/testatomic.c

Posted by William A Rowe Jr <wr...@rowe-clan.net>.
On Mon, Sep 17, 2018 at 10:52 AM Jim Jagielski <ji...@jagunet.com> wrote:

> Would like to also propose for apr-1.7...
>
> *Subject: **svn commit: r1841078 - in /apr/apr/trunk: CHANGES apr.dsp
> atomic/unix/builtins64.c atomic/unix/mutex64.c atomic/win32/apr_atomic64.c
> include/apr_atomic.h include/arch/unix/apr_arch_atomic.h test/testatomic.c*
>
>
+1.