Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Edge vs. Level triggered logic

Edge vs. Level triggered logic

A brief explanation of "edge triggered" and "level triggered" logic.

Tim Hockin

June 02, 2017
Tweet

More Decks by Tim Hockin

Other Decks in Technology

Transcript

  1. Google Cloud Platform
    Kubernetes: Edge vs. Level
    Triggered Logic
    Tim Hockin
    Principal Software Engineer
    @thockin

    View Slide

  2. Google Cloud Platform
    Once upon a time there was hardware
    When the hardware needed attention, it would
    signal the CPU == “interrupt”
    Interrupts used be a literal wire from the device
    to the CPU

    View Slide

  3. Google Cloud Platform
    Device CPU
    interrupt line

    View Slide

  4. Google Cloud Platform
    The device can change the voltage on the wire
    The CPU can detect changes in voltage

    View Slide

  5. Google Cloud Platform
    low voltage
    high voltage
    edge edge

    View Slide

  6. Google Cloud Platform
    Simple: the device “pulses” the interrupt line
    The CPU reacts
    This is “edge triggered”

    View Slide

  7. Google Cloud Platform
    Device CPU

    View Slide

  8. Google Cloud Platform
    Problem: what happens if the CPU doesn’t detect
    a pulse?
    The interrupt doesn’t get serviced!

    View Slide

  9. Google Cloud Platform
    low voltage
    high voltage
    level level

    View Slide

  10. Google Cloud Platform
    The device can change the voltage and keep it
    there until the interrupt is serviced
    The CPU can’t miss edges
    The device can “stack” interrupt reasons - leave
    the voltage until all reasons are ACK’ed
    This is “level triggered”

    View Slide

  11. Google Cloud Platform
    Device CPU

    View Slide

  12. Google Cloud Platform
    What does this mean for Kubernetes?
    State is more useful than events
    Level-driven software is about asserting state
    Clients can check and re-check state at any time
    This is the heart of Kubernetes’ controller model

    View Slide