Operating Systems 2015F Lecture 10

From Soma-notes
Jump to navigation Jump to search

Video

The video from the lecture given on October 9, 2015 is now available.

Notes

Blackboard-concurrency.jpeg


Lecture 10
----------

What's in your final report?
 - The idea (intro)
 - Design/high level implementation
 - implementation (problems encountered)
 - Evaluation (does it work and how do you know)
 - Conclusion
    - contributions
    - limitations
    - future work
 - appendix: code (potentially in patch form)

I suggest you use LaTeX, at least for the code listing
  (may want to look at pandoc and markdown)

Concurrency
 - race conditions
 - producer/consumer
 - locks
    - protecting data structures
    - rendezvous
    - filesystem locks
    - in-memory locks


Processes and threads
 - a process is
    - a CPU context (virtual CPU)
    - plus a private address space
 - a thread is
    - a CPU context (virtual CPU)
    - in a shared address space

 - with threads, all threads see the same memory (within a single process)

Why have threads?
 - because we have multiple CPUs

Why are threads bad?
 - race conditions!
 - memory concurrency!
 - corrupted data!
 - now you need locks in memory!