Provide a synchronized solution to bounded-buffer problem in Java using Java locks
$10-30 USD
Đã hoàn thành
Đã đăng vào khoảng 8 năm trước
$10-30 USD
Thanh toán khi bàn giao
Provide a synchronized solution to bounded-buffer problem in Java using Java locks. Your program must have two threads: one thread writes a random integer into the buffer and the other thread reads the integer written from the buffer. There must be a random time delay between the writes and the reads. Assume after writing and reading 10 integers the threads terminate. You can implement the buffer as a queue with a fixed capacity of 3.