Readers-writers problem, I need to let in 5 readers per writer in the database

90 Views Asked by At

I need to let 5 readers per writer into the database if there's a writer waiting, otherwise, let every reader into the database

Debugging this is very difficult and every time I try anything, I end up with deadlocks everywhere.

Does anyone have a simple, pseudocode algorithm that does this?

0

There are 0 best solutions below