This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.
Section: 33.6 [exec.sched] Status: New Submitter: Lewis Baker Opened: 2025-08-25 Last modified: 2025-08-27
Priority: Not Prioritized
View other active issues in [exec.sched].
View all other issues in [exec.sched].
View all issues with New status.
Discussion:
The wording 33.6 [exec.sched] p4 says:
For any two values
sch1
andsch2
of some scheduler typeSch
,sch1 == sch2
shall returntrue
only if bothsch1
andsch2
share the same associated execution resource.
However, I don't think this requirement is sufficient for schedulers to be considered equal as it is possible to have two different schedulers that share the same associated execution resource but that have different behaviour.
For example, two schedulers of the same type and having the same associated execution resource but where one schedules items with high priority and others with low priority. Ideally we want two schedulers to be equal if and only if they can be used interchangeably such that using either scheduler to schedule work has the same behaviour. Note that some use cases may also want to compare two schedulers as to whether or not they share the same associated execution resource, independently of their scheduling behaviour, however this could be added as a separate operator later, e.g.std::execution::same_resource(sch1, sch2)
.
While the above wording does still permit implementations to return false
even if the associated
execution resources are the same, it is not clear how this definition applies to schedulers
such as an inline_scheduler
(added in P3552) in which has no specific associated
execution resource but where instances nevertheless have the same scheduling behaviour.
One approach to improving this would be to change p4 to refer to the schedulers having the
same scheduling behaviour rather than having the same associated execution resource.
For example, modify 33.6 [exec.sched] p4 to refer to schedulers having the same
scheduling behaviour rather than having the same associated execution resource.
For any two values
sch1
andsch2
of some scheduler typeSch
,sch1 == sch2
shall returntrue
only if bothsch1
andsch2
share the same associated execution resourcehave the same scheduling behaviour.
However, this then raises the question of exactly what "the same scheduling behaviour" is.
For example, what if two schedulers have the same associated execution resource and the
same behaviour for a schedule()
operation, but have different behaviours for customizations
of the bulk()
algorithm?
Proposed resolution: