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
# this is a job interview simulation unfair read write lock in python attempt | |
# i did not run this | |
class Barrier(object): | |
def __init__(self): | |
self.condition = threading.Condition() | |
self.released = False | |
def await(self): | |
with self.condition: |
NewerOlder