I'm writing a program and I'm wondering if it's possible to loop a switch because my program is suppose to emulate a process going into the critical section of a computer. Something like this:
=========================================
You are in the critical section Reader 2
=========================================
=========================================
You are in the critical section Reader 2
You are in the critical section Reader 5
=========================================
=========================================
You are in the critical section Reader 2
You are in the critical section Reader 5
You are in the critical section Writer 2
=========================================
Until it is eventually full which would be with 3 readers and 3 writer
Thanks
If anyone can help it would be greatly appreciated