Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding subsection on Full_Access_Only aspect #1170

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

gusthoff
Copy link
Collaborator

@gusthoff gusthoff commented Jan 6, 2025

Rework of #1146

@gusthoff gusthoff marked this pull request as draft January 6, 2025 09:54
@gusthoff gusthoff added the new section Section using new content label Jan 6, 2025
@gusthoff gusthoff requested a review from pat-rogers January 11, 2025 03:13
@gusthoff gusthoff marked this pull request as ready for review January 12, 2025 19:46
:ref:`volatile type <Adv_Ada_Shared_Variable_Control_Volatile>` or an
:ref:`atomic type <Adv_Ada_Shared_Variable_Control_Atomic>`. (In other words,
if a type is neither volatile nor atomic, it cannot be a full access type.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a reminder that any atomic type is automatically also volatile?


As we already know, the value of a volatile object may be constantly changing,
so the compiler generates code in such a way that the process must read the
value of the volatile object from memory for each access. (In other words, the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider simplifying this:
"so the compiler generates code in such a way that the process must read the
value of the volatile object from memory for each access"
to be instead something like this:
"so the compiler generates code to read the
value of the volatile object from memory for each access"

type, these assignments are performed for the complete 32-bit register, even
though we're updating just a single component of the record object. (Note that
if :ada:`Window_Register` wasn't a *full-access* object, an assignment such as
:ada:`WR.Horizontal_Cnt := 800` could be performed with a 16-bit operation.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding "could be performed with a 16-bit operation": This is in an admonition, but it is central to the concept because it is what the compiler would want to do otherwise, because that is more efficient than manipulating the entire object.

end Show_Registers;

A delta assignment using an aggregate such as :ada:`(WR with delta ...)`
includes reading the value of complete 32-bit :ada:`WR` object from memory,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should "value of complete" be "value of the complete"?

atomic reads and updates, which |mdash| as a whole |mdash| are indivisible,
i.e. they must be done in a single instruction, so that no other instruction
could execute on that same object before the read or update completes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a reminder that atomic implies volatile should go here (instead of above)?


.. admonition:: For further reading...

By running on an PC, we can compare the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"on an PC" should be "on a PC"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new section Section using new content
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants