Initialized empty system:
********WaitQs***************
********Transactions*********
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
R 1 100
Got to lock fn, with locktype = 1, tid = 1, did = 100
the value returned is 0 (NOWAIT)
********WaitQs***************
waitq for did 100: (tid 1, mode R, hold 1), 
********Transactions*********
txlist for tid 1 [running]: (did 100, mode R, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
W 1 100
Got to lock fn, with locktype = 2, tid = 1, did = 100
the value returned is 0 (NOWAIT)
********WaitQs***************
waitq for did 100: (tid 1, mode W, hold 1), 
********Transactions*********
txlist for tid 1 [running]: (did 100, mode W, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
C 1
the value returned is 0 (NOWAIT)
********WaitQs***************
********Transactions*********
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
W 2 200
Got to lock fn, with locktype = 2, tid = 2, did = 200
the value returned is 0 (NOWAIT)
********WaitQs***************
waitq for did 200: (tid 2, mode W, hold 1), 
********Transactions*********
txlist for tid 2 [running]: (did 200, mode W, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
W 3 300
Got to lock fn, with locktype = 2, tid = 3, did = 300
the value returned is 0 (NOWAIT)
********WaitQs***************
waitq for did 300: (tid 3, mode W, hold 1), 
waitq for did 200: (tid 2, mode W, hold 1), 
********Transactions*********
txlist for tid 3 [running]: (did 300, mode W, hold 1), 
txlist for tid 2 [running]: (did 200, mode W, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
W 2 300
Got to lock fn, with locktype = 2, tid = 2, did = 300
the value returned is 1 (WAIT)
********WaitQs***************
waitq for did 300: (tid 3, mode W, hold 1), (tid 2, mode W, hold 0), 
waitq for did 200: (tid 2, mode W, hold 1), 
********Transactions*********
txlist for tid 3 [running]: (did 300, mode W, hold 1), 
txlist for tid 2 [waiting]: (did 200, mode W, hold 1), (did 300, mode W, hold 0), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
W 3 200
Got to lock fn, with locktype = 2, tid = 3, did = 200
the value returned is 2 (DEADLOCK)
Deadlock, so calling droptxlocks for victim tid 3
********WaitQs***************
waitq for did 300: (tid 2, mode W, hold 1), 
waitq for did 200: (tid 2, mode W, hold 1), 
********Transactions*********
txlist for tid 2 [running]: (did 200, mode W, hold 1), (did 300, mode W, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
C 2
the value returned is 0 (NOWAIT)
********WaitQs***************
********Transactions*********
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
R 2 100
Got to lock fn, with locktype = 1, tid = 2, did = 100
the value returned is 0 (NOWAIT)
********WaitQs***************
waitq for did 100: (tid 2, mode R, hold 1), 
********Transactions*********
txlist for tid 2 [running]: (did 100, mode R, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
R 3 200
Got to lock fn, with locktype = 1, tid = 3, did = 200
the value returned is 0 (NOWAIT)
********WaitQs***************
waitq for did 200: (tid 3, mode R, hold 1), 
waitq for did 100: (tid 2, mode R, hold 1), 
********Transactions*********
txlist for tid 3 [running]: (did 200, mode R, hold 1), 
txlist for tid 2 [running]: (did 100, mode R, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
W 2 200
Got to lock fn, with locktype = 2, tid = 2, did = 200
the value returned is 1 (WAIT)
********WaitQs***************
waitq for did 200: (tid 3, mode R, hold 1), (tid 2, mode W, hold 0), 
waitq for did 100: (tid 2, mode R, hold 1), 
********Transactions*********
txlist for tid 3 [running]: (did 200, mode R, hold 1), 
txlist for tid 2 [waiting]: (did 100, mode R, hold 1), (did 200, mode W, hold 0), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
W 3 100
Got to lock fn, with locktype = 2, tid = 3, did = 100
the value returned is 2 (DEADLOCK)
Deadlock, so calling droptxlocks for victim tid 3
********WaitQs***************
waitq for did 200: (tid 2, mode W, hold 1), 
waitq for did 100: (tid 2, mode R, hold 1), 
********Transactions*********
txlist for tid 2 [running]: (did 100, mode R, hold 1), (did 200, mode W, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
C 2
the value returned is 0 (NOWAIT)
********WaitQs***************
********Transactions*********
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
R 501 2000
Got to lock fn, with locktype = 1, tid = 501, did = 2000
the value returned is 0 (NOWAIT)
********WaitQs***************
waitq for did 2000: (tid 501, mode R, hold 1), 
********Transactions*********
txlist for tid 501 [running]: (did 2000, mode R, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
R 502 3000
Got to lock fn, with locktype = 1, tid = 502, did = 3000
the value returned is 0 (NOWAIT)
********WaitQs***************
waitq for did 3000: (tid 502, mode R, hold 1), 
waitq for did 2000: (tid 501, mode R, hold 1), 
********Transactions*********
txlist for tid 502 [running]: (did 3000, mode R, hold 1), 
txlist for tid 501 [running]: (did 2000, mode R, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
R 503 4000
Got to lock fn, with locktype = 1, tid = 503, did = 4000
the value returned is 0 (NOWAIT)
********WaitQs***************
waitq for did 4000: (tid 503, mode R, hold 1), 
waitq for did 3000: (tid 502, mode R, hold 1), 
waitq for did 2000: (tid 501, mode R, hold 1), 
********Transactions*********
txlist for tid 502 [running]: (did 3000, mode R, hold 1), 
txlist for tid 503 [running]: (did 4000, mode R, hold 1), 
txlist for tid 501 [running]: (did 2000, mode R, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
W 503 2000
Got to lock fn, with locktype = 2, tid = 503, did = 2000
the value returned is 1 (WAIT)
********WaitQs***************
waitq for did 4000: (tid 503, mode R, hold 1), 
waitq for did 3000: (tid 502, mode R, hold 1), 
waitq for did 2000: (tid 501, mode R, hold 1), (tid 503, mode W, hold 0), 
********Transactions*********
txlist for tid 502 [running]: (did 3000, mode R, hold 1), 
txlist for tid 503 [waiting]: (did 4000, mode R, hold 1), (did 2000, mode W, hold 0), 
txlist for tid 501 [running]: (did 2000, mode R, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
W 501 3000
Got to lock fn, with locktype = 2, tid = 501, did = 3000
the value returned is 1 (WAIT)
********WaitQs***************
waitq for did 4000: (tid 503, mode R, hold 1), 
waitq for did 3000: (tid 502, mode R, hold 1), (tid 501, mode W, hold 0), 
waitq for did 2000: (tid 501, mode R, hold 1), (tid 503, mode W, hold 0), 
********Transactions*********
txlist for tid 502 [running]: (did 3000, mode R, hold 1), 
txlist for tid 503 [waiting]: (did 4000, mode R, hold 1), (did 2000, mode W, hold 0), 
txlist for tid 501 [waiting]: (did 2000, mode R, hold 1), (did 3000, mode W, hold 0), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
W 502 4000
Got to lock fn, with locktype = 2, tid = 502, did = 4000
the value returned is 2 (DEADLOCK)
Deadlock, so calling droptxlocks for victim tid 502
********WaitQs***************
waitq for did 4000: (tid 503, mode R, hold 1), 
waitq for did 3000: (tid 501, mode W, hold 1), 
waitq for did 2000: (tid 501, mode R, hold 1), (tid 503, mode W, hold 0), 
********Transactions*********
txlist for tid 503 [waiting]: (did 4000, mode R, hold 1), (did 2000, mode W, hold 0), 
txlist for tid 501 [running]: (did 2000, mode R, hold 1), (did 3000, mode W, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
C 501
the value returned is 0 (NOWAIT)
********WaitQs***************
waitq for did 4000: (tid 503, mode R, hold 1), 
waitq for did 2000: (tid 503, mode W, hold 1), 
********Transactions*********
txlist for tid 503 [running]: (did 4000, mode R, hold 1), (did 2000, mode W, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
C 503
the value returned is 0 (NOWAIT)
********WaitQs***************
********Transactions*********
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
R 101 100
Got to lock fn, with locktype = 1, tid = 101, did = 100
the value returned is 0 (NOWAIT)
********WaitQs***************
waitq for did 100: (tid 101, mode R, hold 1), 
********Transactions*********
txlist for tid 101 [running]: (did 100, mode R, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
R 102 100
Got to lock fn, with locktype = 1, tid = 102, did = 100
the value returned is 0 (NOWAIT)
********WaitQs***************
waitq for did 100: (tid 101, mode R, hold 1), (tid 102, mode R, hold 1), 
********Transactions*********
txlist for tid 102 [running]: (did 100, mode R, hold 1), 
txlist for tid 101 [running]: (did 100, mode R, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
W 103 100
Got to lock fn, with locktype = 2, tid = 103, did = 100
the value returned is 1 (WAIT)
********WaitQs***************
waitq for did 100: (tid 101, mode R, hold 1), (tid 102, mode R, hold 1), (tid 103, mode W, hold 0), 
********Transactions*********
txlist for tid 102 [running]: (did 100, mode R, hold 1), 
txlist for tid 103 [waiting]: (did 100, mode W, hold 0), 
txlist for tid 101 [running]: (did 100, mode R, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
W 102 100
Got to lock fn, with locktype = 2, tid = 102, did = 100
the value returned is 1 (WAIT)
********WaitQs***************
waitq for did 100: (tid 101, mode R, hold 1), (tid 102, mode R, hold 1), (tid 102, mode W, hold 0), (tid 103, mode W, hold 0), 
********Transactions*********
txlist for tid 102 [waiting]: (did 100, mode R, hold 1), (did 100, mode W, hold 0), 
txlist for tid 103 [waiting]: (did 100, mode W, hold 0), 
txlist for tid 101 [running]: (did 100, mode R, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
C 101
the value returned is 0 (NOWAIT)
********WaitQs***************
waitq for did 100: (tid 102, mode W, hold 1), (tid 103, mode W, hold 0), 
********Transactions*********
txlist for tid 102 [running]: (did 100, mode W, hold 1), 
txlist for tid 103 [waiting]: (did 100, mode W, hold 0), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
W 102 300
Got to lock fn, with locktype = 2, tid = 102, did = 300
the value returned is 0 (NOWAIT)
********WaitQs***************
waitq for did 300: (tid 102, mode W, hold 1), 
waitq for did 100: (tid 102, mode W, hold 1), (tid 103, mode W, hold 0), 
********Transactions*********
txlist for tid 102 [running]: (did 100, mode W, hold 1), (did 300, mode W, hold 1), 
txlist for tid 103 [waiting]: (did 100, mode W, hold 0), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
C 102
the value returned is 0 (NOWAIT)
********WaitQs***************
waitq for did 100: (tid 103, mode W, hold 1), 
********Transactions*********
txlist for tid 103 [running]: (did 100, mode W, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
W 103 300
Got to lock fn, with locktype = 2, tid = 103, did = 300
the value returned is 0 (NOWAIT)
********WaitQs***************
waitq for did 300: (tid 103, mode W, hold 1), 
waitq for did 100: (tid 103, mode W, hold 1), 
********Transactions*********
txlist for tid 103 [running]: (did 100, mode W, hold 1), (did 300, mode W, hold 1), 
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
C 103
the value returned is 0 (NOWAIT)
********WaitQs***************
********Transactions*********
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
bad line: Q

the value returned is 0 (NOWAIT)
********WaitQs***************
********Transactions*********
*****************************

Enter W 2 100 for W(2,100), etc. or C or Q
