Lectures
- 1. Introduction
- 2. C and C++ Data Types
- 3. Structs, Arrays, Pointers
- 4. Generics, Swapping Pointers, Generic Linear Search
- 5. Comparison Function, C Data Structures
- 6. Stack Implementation
- 7. Stack Implementation (cont)
- 8. Heap Management
- 9. Assembly Instructions
- 10. Activation Records
- 11. C++ Code Generation
- 12. Preprocessing Commands
- 13. Compilation Process
- 14. Sequential Programming Vs. Concurrent Programming
- 15. Concurrent Programming, Semaphore
- 16. Semaphore Usage
- 17. Dining Philosopher Problem, Threading
- 18. Ice Cream Store Problem
- 19. Functional paradigm, Scheme programming language
- 20. Scheme, Flatten Function
- 21. Kawa Development Environment, Mapping Functions
- 22. Lambda Mapping Function, Permutation Function
- 23. Scheme Memory Model
- 24. Python
- 25. Python dictionary
- 26. XML and Python
- 27. Haskell programming language
Programming Paradigms - Lecture 15
|
Get the Flash Player to view video.
Lecture 15 - Concurrent Programming, Semaphore
Transitioning from Sequential Programming to Concurrent Programming in the Ticket Sale Example, Problems with the Sequential Model, Threading Interface, Rewriting the Ticket Example to Use It, Adding a Randomized Threadsleep Call to the Threads to Make the Time Slices Used by the Different Threads Less Uniform, Sample Output of Our Ticket Threads, How a Thread Can be Interrupted in the Middle of a Nonatomic Operation, How Multithreading Can Drastically Speed Up the RSS News Reader by Allowing Some Feeds to be Loaded While the Other Feeds Are Blocked, Allowing Each of the Ticket Threads to Access A Global Pool of Tickets, Rather than Allocating 15 Tickets to Each Agent, How This Can Lead to Problems When Threads Attempt to Access the Shared Data Simultaneously, How We Can Prevent This from Happening By Enclosing the Critical Region within A Semaphore, the Semaphorewait And Semaphoresignal Functions, Modifying the Selltickets Function to Use the Semaphore to Protect the Shared Data, How Changing the initial Value of the Semaphore Can Create Deadlock or Allow Too Many Threads to Access the Shared Data At Once
Prof. Jerry Cain
CS107 Programming Paradigms (Stanford University: Stanford Engineering Everywhere) http://see.stanford.edu Date accessed: 2009-05-09 License: Creative Commons Attribution 3.0 |


