Skip to content

Redesign delay/timeout/timer — move to corosio; remove timer/cancel_at/cancel_after #351

Description

@sgerbino

Summary

The timer-related facilities in Capy overlap significantly and cannot be
implemented without a reactor. As a condition of acceptance, delay() /
timeout() should move to Corosio (keeping a stateless API) and the timer
service should be removed.

Detail

Capy cannot implement delay / timeout without a reactor, and there is
significant overlap among the five timer-related facilities. The agreed direction:

  • Move timeout() and delay() to Corosio, keeping the stateless API.
  • Remove corosio::timer, cancel_at, cancel_after.
  • Implement a std::condition_variable-like single-waiter primitive in Capy.

Acceptance criteria (umbrella / tracking issue)

Sub-items to track (may become separate issues):

  • (a) Move timeout() / delay() to corosio, keeping the stateless API.
  • (b) Remove corosio::timer, cancel_at, cancel_after.
  • (c) Single-waiter condvar-like primitive in Capy.
  • (d) Verify safety with concurrency_hint == 1.
  • (e) Add timeout() time_point overload.
  • (f) Avoid spawning an internal timer thread — let the user provide the thread.

References

Relates to corosio benchmark extra-thread observation; Andrey Semashev's "avoid
internal threads" point.

_Raised by Ruben Perez (Capy review) + Vinnie Falco (Benchmark thread), who
escalated it to a condition of acceptance. Source: Boost ML threads "Capy review"

  • "Benchmark results"._

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions