JMM: Observable Behavior and Nonterminating Executions

31 views Asked by At

Can someone explain to me the meaning of 17.4.9. Observable Behavior and Nonterminating Executions.

What I understand (kind of):

  • this section exists because of the programs which never terminate:

    For programs that always terminate in some bounded finite period of time, their behavior can be understood (informally) simply in terms of their allowable executions. For programs that can fail to terminate in a bounded amount of time, more subtle issues arise.

  • if a thread blocks indefinitely then no external action that goes after the place in the code should be executed:

    An execution may result in a thread being blocked indefinitely and the execution's not terminating. In such cases, the actions generated by the blocked thread must consist of all actions generated by that thread up to and including the action that caused the thread to be blocked, and no actions that would be generated by the thread after that action.

To be honest, even with the above, I don't understand why this section exists.
For example, I don't understand what would break if the section was removed.
Also I don't understand why the rest of the JMM is not enough for nonterminating executions.

0

There are 0 answers