Grokking Multithreading and Concurrency for Coding Interviews
Vote

0% completed

​

Read/Write Locks

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.

  • Reader: A thread that only looks at shared data and never changes it.
  • Writer: A thread that changes shared data.
  • Read/write lock: One lock with two sides. Many readers can hold the read side together, but a writer holds the write side alone.
  • Read lock: The read side of a read/write lock. It is also called shared mode, because many readers can hold it at once.
  • Write lock: The write side of a read/write lock

.....

.....

.....

Like the course? Get enrolled and start learning!
Manohar Simons

Manohar Simons

· 20 days ago

"Multiple threads can simultaneously read the value of the counter without blocking each other."

For python this is not true. The read is also a blocking call

Show 1 reply
Yogesh Patil

Yogesh Patil

· 4 months ago

  1. This program use ReentrantReadWriteLock to protect shared counter. Since all read write protected by locks, volatile is not necessary. isn't it to change the example of Read/Write locks?
3

366movsave

· 2 years ago

For me it is compiling, but I don't see any read/write locks, just a regular mutex.

Show 1 reply
M

mr.anurag

· 2 years ago

C++ code is not compiling in section Examples of Synchronization constructs in Read/Write locks. Can you please correct the code?

Reading Progress

0%


Vote for new content