0 0 votes In a strict alteration , we use TURN variable and turn variable is shared variable .So,my doubt is that there's synchronisation problem as it is similar to producer consumer problem. While executing turn variable there might be preemption and it might cause inconsistency ? So how could strict alteration has this disadvantage? Operating System operating-system process-synchronization + – Srken 1.2k views answer comment Share Follow Print See 1 comment 1 1 comment reply Shubhodeep commented Nov 20, 2022 reply Follow flag If you know the concept of Test-Set-Lock, you know that updating the lock variable is a atomic operation, i.e. no preemption can occur, in turn variable(strict alteration) always ensures updating the variable turn is atomic, and adding to it, it’s a two process solution, until and unless the other process updates turn variable the process will get stuck in the while loop, so no problem like producer consumer can arise 1 1 replyShare Please log in or register to add a comment.
0 0 votes In strict alternation, only two processes are involved, so, when one process enters critical section, it changes value such that only other process will be able to enter. That is why the name Strict Alternation. joleyasarthak answered Nov 21, 2022 joleyasarthak comment Share Follow See 1 comment 1 1 comment reply Srken commented Nov 23, 2022 reply Follow flag Yeah now I've got it . 0 0 replyShare Please log in or register to add a comment.