This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

question on Exclusive access

Hi All,

I am a bit confused with Exclusive access and Locked access

Would you give me example what scenario master will use exclusive access and Locked access? 

Thanks a lot!

Parents
  • Q1:Why a master need to do exclusive read before exclusive write?

    An exclusive write is saying "this write should only succeed if the location has NOT been written to since I did an exclusive read from it".  That lets software implement things like semaphores and mutexes.  

    You can think of the exclusive read as tagging the address.  Subsequents write to the location clear that tag.  The exclusive write happens only if the tag is still there, as that shows no one wrote the location since you read it.  If that tag isn't there, someone else wrote to the location and the exclusive store fails.

    So to answer your question: If you don't do the exclusive read the exclusive write is almost certain to fail.

Reply
  • Q1:Why a master need to do exclusive read before exclusive write?

    An exclusive write is saying "this write should only succeed if the location has NOT been written to since I did an exclusive read from it".  That lets software implement things like semaphores and mutexes.  

    You can think of the exclusive read as tagging the address.  Subsequents write to the location clear that tag.  The exclusive write happens only if the tag is still there, as that shows no one wrote the location since you read it.  If that tag isn't there, someone else wrote to the location and the exclusive store fails.

    So to answer your question: If you don't do the exclusive read the exclusive write is almost certain to fail.

Children