Peterson's solution requires two data items to be shared between the two processes:
- The variable turn indicates whose turn it is to enter its CS. That is, if , then process is allowed to execute in its CS.
- The flag array is used to indicate if a process is ready to enter its CS. For example, if is true, this value indicates that is ready to enter its CS.