Commit Graph

41 Commits (8676c40674fbbb4372f89b0b9804af0a4140a2a0)

Author SHA1 Message Date
David Wilson 6a74edce6b issue #155: parent: move master.Context into parent.
The Context and Router APIs for constructing children and making
function calls should be available in every parent context, as user code
wants to have access to the same API.
7 years ago
David Wilson 54ff1c90fa issue #155: add DEL_ROUTE, propagate ADD_ROUTE upwards
* IDs are allocated by the parent responsible for contructing a new
  child, using ALLOCATE_ID to the master as necessary to allocate new ID
  ranges.

* ADD_ROUTE is sent up the tree rather than down. This permits
  construction of the new context to complete concurrent to parent
  contexts learning about its existence. Since all streams are strictly
  ordered, it's not possible for any parent to observe messages from the
  new context prior to arrival of an ADD_ROUTE from the parent notifying
  of its existence.

  If the new context, for example, implements an Ansible async task, its
  parent can start executing that without waiting for any synchronous
  confirmation from any parent or the master.

* Since routes propagate up, it's no longer possible for a plain
  non-parent child to ever receive ADD_ROUTE, so that code can be moved
  out of core.py and into parent.py (-0.2kb compressed).

* Add a .routes attribute to parent.Stream, and respond to disconnection
  signal on the stream by propagating DEL_ROUTE for any ADD_ROUTE ever
  received from that stream.

* Centralize route management in a new parent.RouteMonitor class
7 years ago
David Wilson 1ed86774b5 issue #156: document select exception 7 years ago
David Wilson 20f5d89dfa issue #156: fix several more races
* Don't need to sleep if queue>sleepers, can just pop the right queue
  element and return it.

* If queue>sleeping and waking==sleeping, no mechanism existed to ensure
  a thread newly added to sleeping would ever be woken. Above change
  fixes that.

* Cannot trust select() return value, scheduler might sleep us
  indefinitely while put() writes a byte.

* Sleeping threads didn't pop FIFO, they popped in whatever order
  scheduler woke them up. Must recover index and use it to pick the pop
  index.
7 years ago
David Wilson 526b0a514b issue #156: prevent Latch.close() triggering spurious wakeups 7 years ago
David Wilson 18e2977baf docs: annoying phrasing 7 years ago
David Wilson 2c22c41819 issue #156: don't decrement `waking` if we timed out rather than being woken. 7 years ago
David Wilson 07a8994ff5 issue #156: waking thread result dictionary with an integer. 7 years ago
David Wilson b5398bd17f issue #156: docs typo 7 years ago
David Wilson 512ff77a46 issue #156: prevent non-sleeping threads from starving sleeping threads.
See new docs
7 years ago
David Wilson 148ce1d703 issue #155: increase context ID width to 32 bits
Needed to make large range allocations (1000 per ALLOCATE_ID roundtrip)
feasible.
7 years ago
David Wilson 03e51fdaa7 docs: mitogen.core.Latch docs 7 years ago
David Wilson 20afa5b90c Latch v2: combined queue + one self-pipe-per-thread
Turns out it is far too easy to burn through available file descriptors,
so try something else: self-pipes are per thread, and only temporarily
associated with a Lack that wishes to sleep.

Reduce pointless locking by giving Latch its own queue, and removing
Queue.Queue() use in some places.

Temporarily undo merging of of Waker and Latch, let's do this one step
at a time.
7 years ago
David Wilson a39cd44bf2 core: add auth_id field. 7 years ago
David Wilson 592ebd59c2 docs: reorder sections 7 years ago
David Wilson dee856f6f4 docs: remove obsolete warning 7 years ago
David Wilson 4d9d21c808 docs: fix typo 7 years ago
David Wilson 4a6d55ced6 docs: vastly simplify importer concurrency docs 7 years ago
David Wilson 984b39180e importer: Beginnings of howitworks section. 7 years ago
David Wilson 038ab04908 docs: convert paragraph to footnote. 7 years ago
David Wilson e3d2c8d649 issue #49: update howitworks.rst for command line change 7 years ago
David Wilson cf0668b2b1 docs: Add warning to preloading section. 7 years ago
David Wilson ac7cada323 docs: more getting started guide 7 years ago
David Wilson ffa063cc01 docs: annother barriage of cross-reference fixes. 7 years ago
David Wilson 9372d2c3de docs: Fix up tons of references, document trust chain 7 years ago
David Wilson 051285437f importer: module preloading docs 7 years ago
David Wilson dcc45bc7de docs: Get started on Getting Started 7 years ago
David Wilson b7a9aa46cf core: More robust shutdown
Now there is a separate SHUTDOWN message that relies only on being
received by the broker thread, the main thread can be hung horribly and
the process will still eventually receive a SIGTERM.
7 years ago
David Wilson 79dd00db5a master: hack to avoid executing __main__. 7 years ago
David Wilson 976c643f21 docs: remove note, unpickling can no longer trigger module loads 7 years ago
David Wilson decc9a900c docs: s/random/pseudorandom/ 7 years ago
David Wilson 83f8f1863e docs: fix pickler docs, begin relabelling master/slave->parent/child 7 years ago
David Wilson 4327baabfa docs: remove final references to call_with_deadline(). 7 years ago
David Wilson dd69b8feeb docs: with_context element is replaced by a decorator. 7 years ago
David Wilson a81f804e92 Accidentally hecked in incomplete paragraph. 7 years ago
David Wilson f1d82c7284 More API documentation. 7 years ago
David Wilson 9d2a11e70f Fix function reference. 7 years ago
David Wilson b7f95e558f Better document Router API and constructors. 7 years ago
David Wilson 9c4bf37cfc Remove final vestiges of context.key. 7 years ago
David Wilson 4720eb1c55 core: add ALLOCATE_ID message for fakessh. 7 years ago
David Wilson e7ff6259a3 Initial commit. 7 years ago