HomePhabricator

ext_asio extension

Description

ext_asio extension

This adds ext_asio extension that reimplements Preparer in C++. The
semantics are preserved as much as possible.

Known changes in semantics:

  • cycle detection was improved: once cycle is detected, C++ preparer does not fail the whole prep() call, but removes one edge of the cycle and injects an exception
  • context tracking was improved: C++ preparer maintains stack of entered contexts and once context is exited, it is actively eliminated; as a result, invariant is maintained that if wait handle A is blocked by wait handle B, the context of B must be at least as specific as the context of A (i.e. if you prep(A), all dependencies are guaranteed to be imported into the context; if that context dies, all remaining wait handles are moved to the parent context); this was not always the case in a rare situations in PHP preparer

Implementation improvements:

  • PHP preparer had only ResultToken (now StaticResultWaitHandle) and AsyncContinuation (now ContinuationWaitHandle); a new types of wait handles were introduced:
  • GenArrayWaitHandle abstracts away the functionality of waiting for an array of dependencies previously implemented as part of AsyncContinuation
  • SetResultToRefWaitHandle separates functionality of multiple result destinations, previously part of AsyncContinuation
  • StaticExceptionWaitHandle was introduced
  • wait handles are now structured in a tree that implements various abstract concepts (WaitableWaitHandle, BlockableWaitHandle, etc.), useful for later introduction of wait handles that can wait for I/O operations

Not implemented:

  • Teak profiling is currently incompatible
  • we plan to introduce better profiling support that will combine sync and async stack traces
  • before improved profiling is available, we plan to collect Teak samples using PHP preparer

Details

Provenance
janAuthored on
Sara GolemonCommitted on Feb 4 2013, 11:04 PM
Parents
rOSHD059d53dda413: Include systemlib.php in repo-authoritative repos
Branches
Unknown
Tags
Unknown
ChangeId
None

Event Timeline