Coder Social home page Coder Social logo

cas ptr about libatomic_ops HOT 4 CLOSED

diakopter avatar diakopter commented on June 21, 2024
cas ptr

from libatomic_ops.

Comments (4)

ivmai avatar ivmai commented on June 21, 2024

Hi Matthew,

Sat, 8 Sep 2012 11:37:14 -0700 Matthew Wilson [email protected]:

The header says "All operations operate on unsigned AO_t, which is the natural word size, and usually unsigned long".

This should be refined, I think. AO_t is typically size_t which should be (normally) the same size of pointer.

Also, there could be atomic operations defined for other types (like char, short, int) on some platforms.

Does this mean it can't CAS a pointer, or that it can? The APR has apratomic_casptr (see http://apr.apache.org/docs/apr/trunk/group__apr__atomic.html), which works for me on 64-bit. But I'm looking at using this library instead for the atomic operations because of the memory barrier precision. So I'm just wondering whether this library will let me CAS pointers on 64-bit.

Yes, cast between a pointer type and AO_t is valid both on 32- and 64-bit targets.

Thanks again!

Reply to this email directly or view it on GitHub.

Regards,
Ivan

from libatomic_ops.

diakopter avatar diakopter commented on June 21, 2024

excellent; thanks

from libatomic_ops.

diakopter avatar diakopter commented on June 21, 2024

AO_compare_and_swap seems not to be implemented on msvc 32-bit. (tested with vs2010). Is it supposed to be?

from libatomic_ops.

diakopter avatar diakopter commented on June 21, 2024

oops, reopened the wrong one

from libatomic_ops.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.