Overview
This is the last lecture.
WeensyDB internals
- Hash table
- Hash function: bucket number = first character of key
dbmap
API
db.bucket(KEY)
- Return bucket number containing
KEY
- Return bucket number containing
db.bbegin(B)
,db.bend(B)
- Iterators to beginning and end of bucket
B
- Iterators to beginning and end of bucket
db.bfind(B, KEY)
- Return iterator to item with key
KEY
- Return iterator to item with key
db.binsert(B, KEY)
- Insert new item with key
KEY
, return iterator to it
- Insert new item with key
db.berase(B, IT)
- Erase item
*IT
- Erase item
Synchronization issues
- Parallelism
- Only one client can access the database at a time
- Data races
- Multiple threads can conflict on concurrent memory access
- Lock granularity
- Unnecessarily strict locking reduces parallelism
- Denial of service
- A misbehaving client can block out all other clients indefinitely
- Deadlock
- Circular locking: a client block itself (and all other clients)
- Lock ordering
- Resource exhaustion
- Too many clients can crash the server
A real example
Next
-
CS 1610: Operating Systems
-
CS 1650: Data Systems (fall)
-
CS 2610: Research Topics in Operating Systemss
-
CS 2630: Systems Security
-
CS 2650: Big Data Systems
-
CS 1530: Compilers (fall)
-
CS 1410: Computing Hardware
-
CS 1480/2480: Design of VLSI Circuits and Systems
-
CS 1450/2450: Networking at Scale
-
CS 96: System Design Projects: Machine Learning for Social Impact
-
CS 1240: Data Structures and Algorithms
-
CS 1430: Networks
-
CS 1750: Computer Graphics
-
CS 1810: Machine Learning
-
CS 1910: Classics of Computer Science
-
CS 2241: Algorithms at the Ends of the Wire (future)
Let’s talk about your commit messages
Most popular commit messages?
-
982
Confirm repository
-
830
Update m61.cc
-
512
Merge branch 'main' of https://github.com/cs61/cs61-f24-psets
-
137
com
-
132
phase 1
-
82
done
-
78
phase 2
-
71
phase 3
Commit statistics
- Average commits per branch
-
52.5
-
- Median commits per branch
-
45
-
- Max commits per branch
-
1214
-
Commit histogram
1214 commits
795 Update m61.cc
137 com
32 comm
5 cc
3 om
3 commit
2 oc
1 vcom
1 omm
1 comx
1 coms
1 como
1 committed
1 commitMerge branch 'main' of https://github.com/cs61/cs61-f24-psets
1 com1
1 ciom
1 cim
1 cf
1 c1
Good company
- ImageMagick is a suite of programs for controlling images
- Used globally
- Written by John Cristy starting in 1987
- Git repository goes back to 2009
- Top commit messages since then:
- 8464 totally blank
- 3325
...
(three dots)
- There are many ways to be a good software engineer
Relatable
04a696a This should pass everything, but honestly I am not even sure
00a0155 forgot my name >_@
8f4388d how is this class real. phase 6 done
lol
0823e96 actually fixed sanitizers lol
0982752 idk if this is right lol
22321f2 NVM I was compiling with sanitizers lol thats why it was slow, phase 2 working yay
2943306 lol
436b82e lol
60dd564 hotfix for last commit lol
7196507 hghly inefficient not working fine grained stuff lol, gonna restart
8a9c3e4 don't free console lol
a3e39bb lol
b19dae5 working in wrong branch lol
b205436 seems to be done lol (forgot to commit during) - can't tell whether non-seqentuals are done well tho
c365237 lol
dae229e one line of code for zombies lol
df9db3e Cache * 10000 lol
e8c934e Up to phase 4 lol phase 3 will maybe be in my dreams forever.
ff37ead failure lol go back to phase 1
!!
1ecc3d5 finalsgit add AUTHORS.md
1f30f83 fixed condition to lseek in readc, need help from Edgit add .
5086913 Finishedgit add ./m61.cc!
56576f8 all tests passed, and commentedgit add .
5e8cb84 [Phase 4] Yayygit status! It was an issue with the initialization of 'current_status'
7538da5 phase 2/3 should be finished nowgit add .
90e1d1d updated readme. EXTRA CREDIT, please gradegit add .
9f7e0bb finishedgit add .
bee5a15 all tests passed wooo hooooogit add .!
ccd47bc phase 4 PIPELINEgit add .
d1f1b74 boomgit add pset2
d265f82 50 testsgit add m61.cc git add m61.cc
d63599d hallelujahgit add m61.cc git add m61.cc git add m61.cc git add m61.cc git add m61.cc git add m61.cc git add m61.cc git add m61.cc git add m61.cc git add m61.cc git add m61.cc git add m61.cc git add m61.cc ! 1-48 pass and correct canary values code
e738930 yes yes yes git add m61.cc git add m61.cc ! hallelujahgit add m61.cc thank you very much!
f6f8a62 donegit add .
f83f0bb step 3 workinggit add kernel.cc!
f87a90b im done! yes! hallelujah! yeeeeeeeeeeeeeeeeeesgit add m61.cc !
Yay!
0249cf2 yay bomb defused!
0790cb4 yay
1049f15 Pset 2 YAYYY
190c04c yAYYY check 18 works
1dbf994 Merge branch 'main' of https://github.com/cs61/cs61-f24-psets yay :qa! :qa!
22321f2 NVM I was compiling with sanitizers lol thats why it was slow, phase 2 working yay
2b49fb4 pset4: attempt 3 :) yay
399baa7 finish docs. yay!
4fe899e changed block size, now everything blue or green yay
5a90eca yay
5b270aa Should be getting a different bug now... yay
62b1c5b yay
6548814 yay
6614bc8 FINALLY DONE YAYAYAYYAYA
80efc19 omg check-c,cn finally work, yay
87922c7 finished yay
8d5de92 upto test46 yayyyy
8e3b698 phase 4 working yay
92eb64f upto test46 yayyyy
9b8950b yay
a41e2fe YAYYY
aa1415d phase3 yay
b5dee48 FINAL CHANGES YAY
bbf59c7 risky stuff worked yay
bfa48b5 bomb defused yay
c63af9a FINALLY PASSED 24 YAYAYYAYAYAY
c97a9f1 yay
df6cfb7 up to test46 yayyyy
e5ad75d done yayy
f9b8edf yay
fb54b20 YAYYYY
ffe525d TEST53 YAYAYYAYAY