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 7892277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:49:47+00:00 2026-06-03T06:49:47+00:00

What is the reason for why is_lock_free requires an instance (it’s a member function)?

  • 0

What is the reason for why is_lock_free requires an instance (it’s a member function)? Why not a metafunction of the type, or a static constexpr member function?

I am looking for an actual instance of why it is necessary.

  • 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-03T06:49:49+00:00Added an answer on June 3, 2026 at 6:49 am

    The standard allows a type to be sometimes lock-free.

    section 29.4 Lock-free property

    The ATOMIC_…_LOCK_FREE macros indicate the lock-free property of the
    corresponding atomic types, with the signed and unsigned variants
    grouped together. The properties also apply to the corresponding
    (partial) specializations of the atomic template. A value of 0
    indicates that the types are never lock-free. A value of 1 indicates
    that the types are sometimes lock-free.
    A value of 2 indicates that
    the types are always lock-free.

    The C++ atomic paper n2427 states the reason behind:

    … The proposal provides run-time lock-free query functions rather
    than compile-time constants because subsequent implementations of a
    platform may upgrade locking operations with lock-free operations, so
    it is common for systems to abstract such facilities behind dynamic
    libraries, and we wish to leave that possiblility open. Furthermore,
    we recommend that implementations without hardware atomic support use
    that technique. …

    And also (as Jesse Good pointed out):

    The proposal provides lock-free query functions on individual objects rather than whole types to permit unavoidably misaligned atomic variables without penalizing the performance of aligned atomic variables

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

Sidebar

Related Questions

I'm wondering what the actual reason is why you can do this on a
I'm trying this and for some reason is not working. I'm suspecting it may
On whatever reason this is not working (says 'file not found'), set in=c:\myprogram\_save cd
I thought up a good use of the static keyword inside a function to
In ASP.NET, is there any reason not to make a set of functions that
In gcc doc one reason is given for using section . This reason is
Background: I've written this before but I don't like the approach. The reason is
I have below a working query that needs to be simplified. The reason is
Edit: The reason queue is 2d is because I need a pointer of Command
Is this a bug in jQueryUI's dialog or is there some reason this is

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.