@@ -55,7 +55,7 @@ This contains some code for testing. You should be able to run: `python3 testing
Your task is to finish a few of the unfinished pieces in the two files.
* (8 pts) Implement IX Locks in `transactions.py`: Currently the code supports S, X, and IS locks. So if a transaction needs to lock a tuple in the X mode, the entire relation is locked. This is of course not ideal and we would prefer to use IX locks (on the relation) to speed up concurrency. The code for this will largely mirror the code for IS. You will have to change the `getXLockTuple()` function and also the `compatibility_list` appropriately.
* (4 pts) Implement `woundWait()` in `transactions.py` for deadlock prevention. This is currently called only by the last test of our testing apparatus, and is every bit as simple as it looks. Choose "younger transactions" by virtue of their transaction IDs (younger w.r.t to transaction1 means that their transaction_id is greater than transaction1).
* (4 pts) Implement `woundWait()` in `transactions.py` for deadlock prevention. This is currently called only by the last test of our testing apparatus, and is every bit as simple as it looks. Input is an array of *transactionID,transactionType* tuples. Choose "younger transactions" by virtue of their transaction IDs (younger w.r.t to transaction1 means that their transaction_id is greater than transaction1).
* (8 pts) Function `detectDeadlocksAndChooseTransactionsToAbort()` in `transactions.py`: The deadlock detection code is called once every few seconds. You should analyze the `waits-for` graph and figure out
if there are any deadlocks and decide which transactions to abort to resolve it. This function only needs to decide which transactions to kill -- our code handles the actual abort (see `detectDeadlocks()`).