Created
June 25, 2013 05:38
-
-
Save awreece/5856175 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# My pseudocode always looks like python. | |
lock_index = get_lock_index(hash_table_index) | |
if lock_index < find_first_set(lock_bitvector): | |
for bit_index set in lock_bitvector: | |
locks[bit_index].unlock() | |
lock(locks[lock_index]) | |
for bit_index set in lock_bitvector: | |
locks[bit_index].lock() | |
else: | |
locks[lock_index].lock() | |
lock_bitvector |= (1 << lock_index) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment