Skip to content

Add resource-aware algorithm registration and execution #21

Description

@knoepfel

Phlex resources are framework-owned, user-defined objects that support algorithm execution without contributing data-flow edges or changing graph topology. Algorithms declare resource dependencies during registration; the framework supplies a resource access value for each invocation and, when needed, uses that value to limit concurrent access.

A resource type is ordinary user code. It need not derive from a Phlex base class or implement a common runtime interface.

Resource Access

Phlex defines three access categories:

  1. Unlimited access: Any number of algorithm invocations may access the resource concurrently.
  2. Single-token access: At most one algorithm invocation may hold the resource token.
  3. Multi-token access: At most one algorithm invocation may run per available resource token.

Algorithms request resources with resource<T>{} after product selectors in input_family(...). The corresponding resource-access values are passed as trailing algorithm parameters.

oneTBB Integration

serial_node and serializer_node were Phlex prototypes used to explore resource-constrained execution. They are superseded by oneTBB's flow::resource_limiter and flow::resource_limited_node, which provide the scheduling mechanism adopted by Phlex.

Delivery Phases

Phase Scope Status
Phase 1 (#851) Static registration; unlimited and single-token resources; resource-aware execution nodes Implemented by PR #850, pending merge
Phase 2 (#852) Resource registration from dynamically loaded plugins Planned
Phase 3 (#853) Multi-token resources and additional token-construction forms Planned; awaits an official supported oneTBB release containing the required limiter constructors

Each phase issue owns its API details, implementation constraints, and acceptance criteria.

Not Currently Scheduled

  • Mutable access to unlimited resources.
  • Named resource instances or multiple instances of one resource type.
  • Duplicate resource dependencies in one algorithm registration.
  • Provider-node resources.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions