I am a little unsure about read and write locks and just need someone to check if these facts about read/write locks are correct.
This is in reference to databases in general.
Read Locks:
- Multiple read locks can be acquired by multiple threads at the same time.
- When a thread has a read lock on a row/table, no thread can update/insert/delete data from that table. (Even if the thread trying to write data doesn't require a write lock.)
- A row/table cannot have a read and a write lock at the same time.
Write Locks:
- When a row/table has a write lock, it cannot be read by another thread if they have a read lock implemented in them but can be read by other threads if no read lock is implemented (i.e simple Select query)
Thanks for the clarification. I cant find direct assertions to these statements on the internets.