K&B book deadlock program is below
it says "Assume that read() is started by one
thread and write() is started by another thread.if there are two different thrads thay may read and write independently,there is a risk of deadlock at line 8 or 16.
I tried to execute the above program with two thread.but i am having trouble how to start two new threads calling read() and write() methods.please help me on this.
my program is