Grokking Multithreading and Concurrency for Coding Interviews
0% completed
Protecting a Critical Section with a Lock
Know the Vocabulary
This lesson uses the terms below many times. Read them once now, and come back here when a later section needs one.
- Shared data: Data that more than one thread can read or change, such as one total of tickets sold.
- Critical section: The part of the code that uses shared data and must run in only one thread at a time.
- Mutual exclusion: The rule that at most one thread at a time may run a critical section.
- Lock: An object that enforces mutual exclusion. A thread takes the lock before the critical section and gives it back after.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%