You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Phase 3 resource support: multi-token resources via oneTBB range-based limiter construction #853
Phase 3 enables multi-token resources: a resource that declares both a token_type and a tokens() member. Each returned token represents one concurrent access slot. A resource offering N tokens bounds a dependent node to at most N concurrent invocations, subject to its configured operator concurrency.
Phase 1 (#851) recognizes this form but rejects it at compile time. It must remain rejected until this phase is complete; Phlex must neither silently reduce a multi-token resource to one token nor emulate multi-token scheduling with a Phlex-specific semaphore.
oneTBB Dependency
The required iterator-range and container constructors for flow::resource_limiter were merged in oneTBB PR #2137. Phlex must wait for an official supported oneTBB release containing those constructors before enabling multi-token resources. Depending on an unreleased upstream branch or commit is out of scope.
Required Work
Require an official supported oneTBB release containing the resource_limiter iterator-range or container constructor.
Add a CMake feature probe for the required constructor.
Materialize tokens() during resource registration and retain token values for the graph lifetime when their type requires it.
Construct resource_limiter<T::token_type> from the complete token range or container.
Reject an empty token collection at registration time. An empty limiter can leave graph::wait_for_all() blocked.
Add tests proving that N tokens allow no more than N concurrent invocations and that multiple token identities are delivered and exercised.
Related Extension: Distinct Single Tokens
A separate extension may support a single token that is not derived from or equal to the registered resource type:
The framework would use token() to construct the one-token limiter. This extension does not require runtime-sized oneTBB resource-limiter support and can be implemented independently of multi-token resources.
Activity
[-]Phase 2 resource support: adopt oneTBB range-based limiter-node construction[/-][+]Phase 3 resource support: multi-token resources via oneTBB range-based limiter construction[/+]