Notas
Sem título
Conteúdo das notas (1)
Página 1
User A and User B try to read X.
Say they are doing ATM updates.
A wants to add five dollars, x = x+ 5. This requires an update.
B wants to add ten dollars, x = x+10. This requires an update.
Look up Lost Update & Uncommitted Dependency on Book/Internet
Readlock (Sharedlock)
If you want to read, you must establish a read lock
Writelock
Exclusive lock if I want to write, I must establish a write lock
To set a read lock
If there are no write locks, I can set a read lock
To set a write lock,
If there are no locks except mines, I can put a write lock
If lock can't be set, wait. This applies to read and write locks.
Commits rollbacks and releases locks.
To solve these problems, we use Deadlock.
Look up the Dining Philosophers
3 Requirements of Dealock
Share of lockable resources
Non-premption: Have to wait, can't take fork from someone else
Circular wait
Every transaction receives a globally unique timestamp. No two time stamps are the same, one is bigger than the other.
A younger transaction has a bigger timestamp.
When request and item that is locked:
Wait and die - if A is older than B, A waits. Else A dies (rollback) restarts.
Wound and wait - if A is younger than B, A wounds B, which means B dies (rollback & restart)
Informações
- Descrição
- Database Systems (11/15/17) Notas sobre Sem título, criado por SERGIO GUTIERREZ em 27-11-2017.
- Criado por
- SERGIO GUTIERREZ
- Visualizações
- 0
- Avaliação