Interview Bootcamp
Vote

0% completed

​

Concurrency and Coordination

Two people want the last seat on a flight. They both tap "Book" at the same moment, on different phones. Both screens say "Booked!" The airline now has two passengers and one seat.

Nothing crashed, and both requests ran correct code. The problem is that they ran at the same time, on the same data.

This lesson answers three questions. How do we stop work that runs at the same time from damaging shared data? How do many machines agree on things, like which one is in charge? And when data has copies in many places, what can a reader expect to see?

.....

.....

.....

Like the course? Get enrolled and start learning!
Challa Sriniketh

Challa Sriniketh

· 22 days ago

Whats the main difference between sequential consistency and Linearizability?could you pls explain with an example

Show 1 reply
D

dinko.osrecki

· 3 months ago

Isn't a mutex missing from the Synchronization list?

Also semaphores are really badly explained. Semaphores control how many threads can pass it and reach a resource pool. They can be either binary (open/closed), or counting semaphores (N > 1). Each thread that passes the semaphore increments the counter, and once N is reached other threads are blocked until one of existing threads exits the critical block and decrements the semaphore. Practical example is controlling access to the connection pool. Semaphores are like a capacity management tool.

Mutex, on the other hand, gives exclusive right to a single thread to access a resource. If many concertgoers are running to the toilet the first one that gets there will enter and lock it. Once they are done they will unlock it and the next one

Show 1 reply
S

Shishir

· 3 years ago

Can you please elaborate on the difference between Strong Consistency and Linearizability? Thanks!

Simo

Simo

· 3 years ago

Both these strategies sounds like a process needs to wait for a condition to be met before proceeding. Can you give real-world examples for Barriers and Condition variables?

Show 1 reply
A

atomicdefinition

· 3 years ago

I'm a bit confused about the differences between them. It seems like "concurrency control" is all about synchronizing multiple processes or threads, which is basically the same as "synchronization."

Show 1 reply

Reading Progress

0%


Vote for new content