-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Full name of submitter (unless configured in github; will be published with the issue): Jiang An
Reference (section label): [intro.progress]
Link to reflector thread (if any):
Issue description:
[intro.progress] p1 currently says
The implementation may assume that any thread will eventually do one of the following:
- terminate,
- make a call to a library I/O function,
- perform an access through a volatile glvalue, or
- perform a synchronization operation or an atomic operation.
Note that P2809R0 wants to add trivial potentially infinite loops to the list.
It is unclear whether once one of these operations (except for termination) has been done, the rest of execution can still be affected by such assumption. Transformation of potentially infinite loops would be seriously restricted if the assumption can't be done after these operations.
Presumably the assumption is allowed in every point of the execution except for those in these operations themselves, and we should avoid the possibly ambiguity of "eventually".
Suggested resolution:
Change [intro.progress] p1 as indicated:
The implementation may assume that any thread will eventually do one of the followingAn abstract jump point is agoto
statement (8.7.6 [stmt.goto]), the beginning of a function, or the beginning of the statement of a loop (8.6.1 [stmt.iter.general]) Once a thread has started or completed one of the following operations except for termination, if the thread will execute abstract jump point for infinite times before executing any of the following operations, the behavior is undefined:
[...]