Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9085205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:11:21+00:00 2026-06-16T21:11:21+00:00

There’s some material online about how to write 64 bit atomic code, for example:

  • 0

There’s some material online about how to write 64 bit atomic code, for example:

How to guarantee 64-bit writes are atomic?

.. but before I go down that road, I’d prefer to use an Android NDK / ARM specific solution if there is one.

I’m porting a C++ engine which needs 32 and 64 bit atomic operations. I researched and implemented the GCC built-in __sync_* functions, but when it came time to link I got these kind of errors for the 64 bit operations:

error: undefined reference to '__sync_fetch_and_or_8'
error: undefined reference to '__sync_lock_test_and_set_8'
error: undefined reference to '__sync_fetch_and_and_8'
error: undefined reference to '__sync_fetch_and_add_8'
error: undefined reference to '__sync_val_compare_and_swap_8'

I’m targetting armeabi-v7a, which I’ve read has some assembly instructions for 64 bit atomic (ldrexd/strexd), so is there a way to access them via the GCC built-in atomics? If not, what are the other options?

  • use a mutex to protect each 64 bit operation
  • write assembly code to take advantage of ldrexd/strexd
  • pass a super secret flag to the NDK toolchain to enable 64 bit intrinsics?
  • wait for ARMv8? 🙂

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T21:11:22+00:00Added an answer on June 16, 2026 at 9:11 pm

    Since my question, NDK r8d was released which supports built-in 64-bit atomics.

    http://developer.android.com/tools/sdk/ndk/index.html

    Backported 64-bit built-in atomic functions for ARM to GCC 4.6.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are nice SO question and answers about this issue, but these options didn't
There was some code like this: // Convenience to make things more legible in
There's a Rails 3.2.3 web application which doesn't use any database. But in spite
There was a similar question posted asking in general about alternatives to Qt. Well,
There's example: http://www.jquery4u.com/jquery-functions/setinterval-example/#.UHW6_IYY18E Hover over RSS feedburner image - it will shake. In my
There is some unknown problem with my facebook app running on heroku Problem is
There's a bright pixel row (some kind of reflection or so) through all items
There is always some space above my header. How can I remove it? My
There is any R packages for calculation period of some function? I am looking
There was a thread on this in comp.lang.javascript recently where victory was announced but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.