Codemash 2018 – A Brief Introduction Into Concurrent Programming

Presenter: Rob Keefer

  • Example of processor concurrency
    • 1 hertz – 1 ‘turn of the crank’ per second
      • modern cpu’s 300 Gigahertz – 3 billion per second
    • Chess player playing multiple games example
      • Player looks to see if player has moved yet, if not moves on to different game
        • Processor does this as well, looks at queue, if nothing happening moves to next thread.
      • Dual core, similar to having two players servicing many one on one matches.
        • Sharing resources means don’t get one for one throughput improvement when adding another core.
    • Problems with concurrency
      • starting processes
      • communicating between processes
      • Shared Resources
        • Live version of five philosophers blocking problem
          • Waiting for two chopsticks
          • Deadlock  as shown by Dr. Suess Zaks video
        • Livelock
          • Two people meeting in a hallway, keep blocking by making same moves to mitigate. Still active, so live lock
        • Race Condition
    • Approaches to managing resource contention
      • Traditional – preventive, avoid failure
        • Monitor
        • Mutex
          • Double lock, one to lock resource and one to make sure we are only one with the inner lock.
        • Prioritization Algorithms
      • Newer approaces – embrace failure
        • embrace process death and ressurection
        • support atomic functions (then no need to interleave operations)

Leave a Reply

Your email address will not be published. Required fields are marked *