Skip to content

CWG2816 [intro.progress] The meaning of "eventually" is unclear #304

@frederick-vs-ja

Description

@frederick-vs-ja

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 following An abstract jump point is a goto 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:
[...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions