Skip to content
UoL CS Notes

Home

This website houses notes from my studies at the University of Liverpool. If you see any errors or issues, please do open an issue on this site's GitHub.

Context-Free Languages

COMP218 Lectures

Precedence in Arithmetic Expressions Consider we run the following in the python shell: >>> 2 + 3 * 5 17 This could be represented as the following trees: graph subgraph 25 25*[*] --- 25+[+] & 255[5] 25+ --- 252[2] & 253[3] end subgraph 17 17*[*] --- 17+[+] & 175[5] 17+...

Read More

Locks, Logging & Recovery

COMP207 Tutorials

This covers tutorial 4. Add links to answers to this tutorial. Locks See the answers for tutorial 4 for this question. Logging & Recovery Recovery with undo-logging: Change the value of $X$ on disk back to 10 and call abort for $T_1$ and $T_2$. Change: $Z=30$ $X=10$ on disk and...

Read More

Distributed System Architectures - 1

COMP201 Lectures

Architectural Design This stage represents the link between specification and design processes: Often carried out in parallel with some specification activities. Involves identifying major system components and their communications. Architectural Design Process System Structuring The system is decomposed into several principal sub-systems and communications between these sub-systems are identified. Control...

Read More

Stages of Design & Modular Programming

COMP201 Lectures

Software Design The requirement for software should be split into several object-oriented classes so that development can be distributed between several developers. Additionally the end software needs to be: Simple Understandable Flexible Portable Re-usable Stages of Design Problem Understanding Look at the problem from different angles to discover the design...

Read More

Other Kinds of Logging (Redo & Undo/Redo)

COMP207 Lectures

Redo Logging Logs activities with the goal of restoring committed transactions (ignoring incomplete transactions). Log Records: Same records as before and… New meaning of <T, X, v>: Transaction T has updated the value of database item $X$ and the new value of $X$ is $v$. Direct response to write(X) This...

Read More

Undo Logging

COMP207 Lectures

Logging The following activities should be written to the log so that a desired database state can be recovered later: Starts of transactions, commits and aborts. Modification of database items. This should be implemented in such a way that it should work even if the system fails. You can use...

Read More

Aborting Transacions

COMP207 Lectures

Reasons For Transaction Abortions Errors while executing transactions: Violation of integrity constraints, other run-time errors. Multiple people in a seat that should only relates to one customer. Deadlocks: Concurrency control requests to abort transactions. When using two-phase locking. Explicit Request: User says ROLLBACK; after they START TRANSACTION;. Reasons Beyond the...

Read More

More Flexible Locks, Deadlock & Granularity

COMP207 Lectures

Basic locks are very simple, but not very precise: If we just want to read we need a full lock, even though conflicts don’t happen on a read-read. 2PL Issues 2PL ensure conflict-serialisability, by might lead to: Deadlocks - Where transactions are forced to wait forever. Other issues to be...

Read More

2PL Conflict-Serialisability Proof

COMP207 Lectures

See Locking Conflict-Serialisable Schedules for how two phase locking works. If $S$ is a schedule containing only 2PL transactions, then $S$ is conflict-serialisable. Claim: We can move all operation of $T_i$ to the beginning of the schedule (using swaps of consecutive non-conflicting operations). No formal definition is given in this...

Read More