1. 26
  1.  

  2. 4

    membar_producer() → Force visibility of all of the above changes.

    I believe this has to do with caching and ensures the new values will be up-to-date even when read from main memory by some consumer of this data, e.g. by the scheduler which could be running on another CPU. (I haven’t checked the code though so this is just a guess and might not reflect the actual semantics 100%.)

    Nice article!

    1. 2

      Yeah, I don’t know much about membar barrier operations but like I have read some blogs and some pieces of information that I found on google that it is something which is related to ordering-reordering of LOAD-STORE operations between on multiprocessor systems (in SMP). “The techniques for making memory visible from a processor core are known as memory barriers or fences. They make program state visible to other CPUs so they can act upon it.” – (From some blog that I have read)

      Thank you for your update on memory barrier I will update the same on the blog.

      Thanks for your feedback on the article. This keeps me motivated for going further to learn more and share my learnings.