To avoid deadlock, I used a possible solution. The odd numbered philosophers grab the right and then the left while even numbered philosophers grap the chopsticks in the reverse order. Implement this solution using pthread mutual exclusion lock.
Please look at my code, although it works,but the... (4 Replies)
Discussion started by: zhshqzyc