Nested condition variables are fun!

That release and acquire surrounding the wait are how you allow one of the timelines to start slipping relative to the other one.

def current_updates(self):
    with self.app.cond:
        self.app.cond.wait_for(
            lambda: self.app.positions_ready
        )
        while 1:
            if not self.app.isConnected():
                self.stop()
            if not self.running:
                break
            with self.cond:
                # Skip all position updates while dead-reckoning
                if self.dead_reckoning:
                    self.app.cond.release()
                    self.cond.wait_for(lambda: not self.dead_reckoning)
                    self.app.cond.acquire()
                current = self.app.positions.copy()
                if self.current != current:
                    self.current = current
                    self.cond.notify_all()
            self.app.cond.wait(timeout=2)

Condition variables

Original code on GitHub Gist

Managing cost centers by making them profit centers

https://techcrunch.com/2017/05/14/why-amazon-is-eating-the-world/

Amazon benefits not only from the revenue from externalising its internal services,  but also from the efficiency and oversight induced as a result.

This is similar to the export-driven growth described in Joe Studwell's How Asia Works - East Asian countries gave domestic industries protected markets, conditional on their ability to export and hence prove that they were making goods that were competitive in international markets.