This document presents algorithms for solving the producer-consumer problem using locks in NachOS. It includes code for a producer and consumer that each acquire locks before accessing a shared resource, and algorithms for testing the lock functionality, including for fairness, liveness, and safety. Safety is demonstrated by intentionally creating a deadlock between two locks to show they cannot be acquired simultaneously by different threads.