A message for Linux.com registered users: We are in the process of making changes to the Linux forums. Starting Monday, 8/13/18 at 6:00 PM PT, you will be unable to access the forums. They will re-launch as soon as possible on Wednesday, 8/15/18 with new features and improved functionality. Thank you for your patience and stay tuned for the new improved forums.
I believe that the deadlock problem can be solved if we add a bounded time to the circular wait. By doing so we can eliminate the hold and wait criteria for the deadlock, thus deadlock is prevented. Picture a 4 way traffic stop and all the lights turn read, a timer then goes on which allows pedestrians to walk in all directions. Without the time, there would be a deadlock because the cars would not be able to move but when the time hits zero the light on one direction turns green. Coding this can be possible adding a time constraint in the while loop or busy wait which illustrates the circular wait. Is this possible?