Arm Community
Site
Search
User
Site
Search
User
Groups
Research Collaboration and Enablement
DesignStart
Education Hub
Innovation
Open Source Software and Platforms
Forums
AI and ML forum
Architectures and Processors forum
Arm Development Platforms forum
Arm Development Studio forum
Arm Virtual Hardware forum
Automotive forum
Compilers and Libraries forum
Graphics, Gaming, and VR forum
High Performance Computing (HPC) forum
Infrastructure Solutions forum
Internet of Things (IoT) forum
Keil forum
Morello Forum
Operating Systems forum
SoC Design and Simulation forum
中文社区论区
Blogs
AI and ML blog
Announcements
Architectures and Processors blog
Automotive blog
Graphics, Gaming, and VR blog
High Performance Computing (HPC) blog
Infrastructure Solutions blog
Innovation blog
Internet of Things (IoT) blog
Operating Systems blog
Research Articles
SoC Design and Simulation blog
Tools, Software and IDEs blog
中文社区博客
Support
Arm Support Services
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Support forums
Arm Development Studio forum
Why we need CLREX in exception handler?
Jump...
Cancel
Locked
Locked
Replies
2 replies
Subscribers
121 subscribers
Views
2356 views
Users
0 members are here
Options
Share
More actions
Cancel
Related
How was your experience today?
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
Why we need CLREX in exception handler?
Offline
Cheng Liang Chiu
over 9 years ago
Note: This was originally posted on 15th October 2012 at
http://forums.arm.com
Dear Sirs:
We check the state diagram and don't know why we need to perform CLREX in exception handler;
1. once another thread success did the STOREX before the original thread performed the exception handler. The original thread would execute STOREX fail after finished the exception handler.
2. If there is no thread did the STOREX, the original thread could success execute STOREX and perform the exclusive access.
Why we need CLREX in exception handler? Do I miss anything?
Regards
Liang
Offline
Cheng Liang Chiu
over 9 years ago
Note: This was originally posted on 16th October 2012 at
http://forums.arm.com
Dear Isogen74:
Thanks for your reply in detail. Help us to clarify our thinking.
Regards
Liang
Cancel
Up
0
Down
Cancel
Offline
Peter Harris
over 9 years ago
Note: This was originally posted on 15th October 2012 at
http://forums.arm.com
R.e. (1) Yes, the issue isn't the thread you are switching out, it is the thread you are switching in. Consider:
You can have an implementation of an exclusive monitor on a uni-processor system without an address tag. You pre-empt a thread which has loaded exclusive A, but not yet stored it. The exclusive monitor is set because the store has not happened yet. You restore a thread which previously loaded exclusive B at a totally different address and run it's exclusive store. This succeeds because the exclusive monitor is still set from Thread A. Given a third thread may have already modified exclusive B (between the load and (possibly much later) store of the second thread) you've just corrupted memory - leaving the exclusive bit set is not thread safe..
R.e. (2) You can't design a computer architecture which is robust based on comments like "if there is no thread ...". The OS doesn't know if the thread it switches in will use STREX or not. To ensure reliable operation it has to assume that it will.
Clrex ensure that the thread which is just switched in always fails the store, and retries with the latest state in memory - i.e. gets the latest version.
Cancel
Up
0
Down
Cancel