Operating system concepts-2
Ace multithreading, Pthreads, synchronization, locks, semaphores, concurrency, deadlocks questions in competitive exams, job interviews, and OS course exams.
1 why threads
2 overheads of using processes
Key idea behind threads
Single vs multithreaded processes
Benefits of threads
Pthread basics
Creating a thread using Pthread
Passing parameters to thread
Pthread_self, Pthread_equal
Thread termination
Pthread_join--waiting for a thread to terminate
Returning values from thread functions
Waiting for threads
Pthread_detach--detaching a thread
Correct usage of pthread_join
Global variables in threads
Introduction to concurrency--nondeterminism in concurrent programs
What is concurrency? An example.
Race condition and atomic operations
Mutual exclusion terminology and synchronization example
Correctness properties for synchronization solutions
Too much milk problem, approach 1
Too much milk problem, approach 2
Enforcing mutual exclusion
Shared variables and mutual exclusion requirements
Too much milk problem, approach 3
Locks
Locks in Pthreads
Locks in multiple critical sections
Lock granularity
Deadlock with locks
Mutual exclusion requirements from lock based solutions
Semaphores
More about semaphores, POSIX semaphores
Synchronization patterns-bounded concurrent access, signaling
Employing semaphores to avoid busy waiting
Testing multithreaded programs
Multithreading and multicores
Challenges of multicore programming
Multithreading and single core
Designing multithreaded programs
Parallel computation using multithreaded programs
Thread pools
Supercomputing