Discussion
An optimisation must be suppressed for a variable declared volatile because
Answer: A
Correct answer: its value may change by means the compiler cannot see
A volatile object may be a memory-mapped device register or a location written by another thread or a signal handler, so the compiler’s reasoning about what the program does to it is incomplete. Every read and write must therefore be performed exactly as written, in order, and none may be cached in a register or elided.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development