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

Towards Meta-Level Engineering and Tooling for Complex Concurrent Systems

Towards Meta-Level Engineering and Tooling for Complex Concurrent Systems

Stefan Marr

March 24, 2016
Tweet

More Decks by Stefan Marr

Other Decks in Research

Transcript

  1. Stefan Marr,
    Elisa Gonzalez Boix, Hanspeter Mössenböck
    Towards
    Meta-Level Engineering and Tooling
    for
    Complex Concurrent Systems

    View full-size slide

  2. ApplicaFons in the MulFcore Age
    2
    Concurrency Model: event-loops or actors
    User Interface
    asynchronous
    event-driven

    View full-size slide

  3. ApplicaFons in the MulFcore Age
    3
    ~/Library/Mail$ sqlite3 EnvelopeIndex
    SQLite version 3.7.7.1sqlite> .schema
    CREATE TABLE addresses (ROWID int,
    address, comment);
    CREATE TABLE messages (ROWID int,
    message_id, document_id, in_reply_to, remote_id int, sender int…);
    Data Storage consistency required
    transacFonal backends
    Concurrency Model: transacFonal operaFons

    View full-size slide

  4. ApplicaFons in the MulFcore Age
    4
    Data Analysis and Processing performance sensiFve
    Concurrency Model: data-parallel queries, map/reduce,
    fork/join, …

    View full-size slide

  5. And, This is Real!
    hUp://stefan-marr.de/
    2014/07/why-is-concurrent-
    programming-hard/
    5
    Tasharofi, S.; Dinges, P. &
    Johnson, R. E.
    Why Do Scala Developers Mix
    the Actor Model with other
    Concurrency Models?
    ECOOP 2013.
    Apple Mail

    View full-size slide

  6. How to provide tooling for all of them?
    6

    View full-size slide

  7. Research Challenges
    •  Debugger for MulFple Concurrency Models
    •  Minimizing Interference
    7
    How to Abstract from
    Concurrency Models?

    View full-size slide

  8. A DEBUGGER FOR SUCH
    APPLICATIONS
    SupporFng a Wide Range of Concurrency Models.
    8

    View full-size slide

  9. Subsystems as
    CommunicaFng Event Loops
    9
    Actor A Actor B
    Actor Principle

    View full-size slide

  10. Subsystems as
    CommunicaFng Event Loops
    10
    Actor A Actor B
    In Theory: One Message at a Time

    View full-size slide

  11. Subsystems as
    CommunicaFng Event Loops
    11
    Actor A Actor B
    Actors Contain Objects

    View full-size slide

  12. Subsystems as
    CommunicaFng Event Loops
    12
    Actor A Actor B
    Which message cause which changes?

    View full-size slide

  13. Subsystems as
    CommunicaFng Event Loops
    13
    Actor A Actor B
    caused? caused?

    View full-size slide

  14. Subsystem uses TransacFons
    14
    Actor A Subsystem B

    View full-size slide

  15. Subsystem uses TransacFons
    15
    Subsystem B

    View full-size slide

  16. Subsystem uses TransacFons
    16
    Subsystem B

    View full-size slide

  17. Subsystem uses TransacFons
    Subsystem B
    Thread A
    Thread B

    View full-size slide

  18. Subsystem uses TransacFons
    Subsystem B
    Thread A
    Thread B
    Thread A

    View full-size slide

  19. Subsystem uses TransacFons
    Subsystem B
    Thread A
    Thread B
    Thread A
    Thread B
    How did transacFons interact?

    View full-size slide

  20. Requirements
    •  High-level representaFon of concepts
    •  Move between abstracFon levels
    •  Enable
    – Observe AcFons (History)
    – Understand Dependencies
    – Interact and Explore
    20

    View full-size slide

  21. MINIMIZING INTERFERENCE
    Research Challenge
    21

    View full-size slide

  22. Shared Resource in
    Message-based System
    22
    Synchro
    nizer
    Shared
    “Mutable”
    Resource
    Added later,
    forgot about synchronizer

    View full-size slide

  23. Shared Resource in
    Message-based System
    23
    Synchro
    nizer
    Shared
    “Mutable”
    Resource
    75% probability
    25% probability

    View full-size slide

  24. AUaching Debugger
    24
    Synchro
    nizer
    Shared
    “Mutable”
    Resource
    Debugger

    View full-size slide

  25. With Debugger
    25
    Synchro
    nizer
    Shared
    “Mutable”
    Resource
    Debugger
    99% probability
    1% probability

    View full-size slide

  26. Tradeoff: Precision vs. Interference
    •  How to minimize recorded data?
    – Maximize re-synthesized informaFon
    – ParFal re-execuFon?
    •  Independent of the concurrency model?
    26

    View full-size slide

  27. HOW TO ABSTRACT FROM
    CONCURRENCY MODELS?
    Research Challenge
    27

    View full-size slide

  28. What are common properFes
    for debugging?
    28

    View full-size slide

  29. Causality: Control & Data Dependencies
    29
    Details different for each Concurrency Model

    View full-size slide

  30. Scheduling Dependencies
    30
    Async message sends,
    rendevous semanFcs,
    blocking semanFcs, ...

    View full-size slide

  31. Challenge:
    Support Wide Range of Concepts
    ConflicFng Goals
    – ImplementaFon Level: Use common abstracFons
    – Tool Level: Show expected semanFcs
    31
    EnFty Event
    causes
    influences
    *
    *

    View full-size slide

  32. SOMns: A Smalltalk with Actors
    32


    JavaScript, Node.js 5.4.0
    JavaScript, GraalJS
    Ruby, JRuby+Truffle
    SOMns, Newspeak
    Java, 1.8.0_66
    1 2 3 4 5 6 7 8 9 10 11 12
    Runtime Factor, normalized to Java 1.8.0_66 (lower is better)
    Dynamic Language Research Planorm
    Faster than V8

    View full-size slide

  33. Actor Performance
    On Par with JVM Frameworks
    33
    Chameneos
    ConcurrentSorted
    LinkedList
    Counting ForkJoinThroughput PingPong RadixSort ThreadRing Geo Mean
    0
    1
    2
    3
    4
    5
    6
    7
    8
    Runtime factor over Scalaz
    lower is better
    Akka Jetlang SOMns Scalaz

    View full-size slide

  34. Research Goals
    •  Debugger for MulFple Concurrency Models
    •  Minimizing Interference
    34
    How to Abstract from
    Concurrency Models?

    View full-size slide