def philosopher(left, right): while True: with acquire(left, right): print(threading.currentThread(), 'eating')
def thread_2(): while True: with acquire(y_lock): with acquire(x_lock): print("Wątek-2") time.sleep(1)
def thread_1(): while True: with acquire(x_lock): with acquire(y_lock): print("Thread-1") time.sleep(1)
def thread_2(): while True: with acquire(y_lock, x_lock): print('Trhead-2')
def thread_1(): while True: with acquire(x_lock, y_lock): print('Thread-1')
def thread_2(): while True: with acquire(y_lock, x_lock): print("Thread-2") time.sleep(1)
def thread_1(): while True: with acquire(x_lock, y_lock): print("Thread-01")
def thread_2(): while True: with acquire(y_lock, x_lock): print("Thread-2")
def thread_1(): while True: with acquire(x_lock, y_lock): print("Wątek-1")
def thread_2(): while True: with acquire(y_lock, x_lock): print("Wątek-2")