svn commit: r253876 - in projects/atomic64/sys/i386: i386 include

Attilio Rao attilio at freebsd.org
Fri Aug 2 14:35:44 UTC 2013


On Fri, Aug 2, 2013 at 2:08 AM, Jung-uk Kim <jkim at freebsd.org> wrote:
> Author: jkim
> Date: Fri Aug  2 00:08:00 2013
> New Revision: 253876
> URL: http://svnweb.freebsd.org/changeset/base/253876
>
> Log:
>   - Implement atomic_cmpset_64(), atomic_swap_64(), and atomic_testandset_64()
>   for i386.
>   - Reimplement atomic_*_64_i386() in C to make it more pleasant to read.
>   Note the generated code may not be optimal but much easier to maintain.

Please don't do this.

The reason why we never had 64 bits atomic on 32-bits architectures is
because we never could implement them in efficient way, namely without
disabling interrupts.
If we make 64 bits atomics available on every 32 bits architecure by
implementing the slow way we could end up developing some patterns in
MI layers which depend on them that end up by being much slower than
expected.

If you want to implement such functions to use only on i386 internal
code it is a different story but you must absolutely use a different
name by atomic_xxx_64() to stress-out the difference, either comment
out that they are heavier than expected and should be careful used.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein


More information about the svn-src-projects mailing list