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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:05:01+00:00 2026-06-13T23:05:01+00:00

My class has a property: @property (readwrite, atomic) BOOL IsTrue; My understanding of the

  • 0

My class has a property:

@property (readwrite, atomic) BOOL IsTrue;

My understanding of the atomic qualifier is that the @synthesized getter/setter for the property will guarantee serialisation of access from different threads, i.e. if producer thread A is setting the property value it will be allowed to complete the set operation before consumer threads B and C are allowed to get the property value (as an aside here, is atomic even necessary for a single byte/POD type?).

Does the volatile keyword provide any further data integrity?

@property (readwrite, atomic) volatile BOOL IsTrue;

What I’m specifically driving at is that is there the possibility of consumer threads getting out-of-date values without the use of volatile?

  • 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-13T23:05:02+00:00Added an answer on June 13, 2026 at 11:05 pm

    is there the possibility of consumer threads getting out-of-date
    values without the use of volatile?

    No. From a client’s point of view, the property is just a getter/setter method pair. So any client needs to call objc_msgSend to set or retrieve a value. Function calls are synchronization points in C so there’s no way of getting out of date values (as with direct memory access, where volatile might be helpful).

    The @synthesize’d accessors will take care of serializing access to the underlying value.

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

Sidebar

Related Questions

I have a class that has a property that I need to stub. I
I have a class that has the following property that is generated by the
I have a Menu class that has a IQueryable property called WebPages. In the
I have come across a class that has an immutable property: MyObject[] allObjs The
I have a class called Question that has a property called Type. Based on
Say I have a tableview class that lists 100 Foo objects. It has: @property
My ViewModel class has a property that contains a ShareClass object. ShareClass has a
One of my class has a property: Dictionary<int, MyObject> I get the error that
I know that the EKEventStore class has the @property NSArray *calendars that returns an
I have an Obj-C 2.0 class that has an NSMutableArray property. If I use

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.