3 votes 3 votes Ans:2 Operating System ace-test-series operating-system process-synchronization + – amitqy asked Dec 26, 2018 • edited Mar 3, 2019 by I_am_winner amitqy 929 views answer comment Share Follow See all 14 Comments See all 14 14 Comments reply Show 11 previous comments amitqy commented Dec 27, 2018 reply Follow Share both read(x) and write(x) will happen inside the statement x = x+1.That's why I think it should not be atomic. 0 votes 0 votes BharathiCH commented Dec 27, 2018 reply Follow Share @Rishav Kumar Singh x=x+1 is not a atomic operation it follows 3 steps equivalent to (1)Load the value of x (2) increment x to 1 (3) store the value of x The process can be preempted at any step The gate question is having semaphores.. and semaphores are atomic.. 0 votes 0 votes Rishav Kumar Singh commented Dec 27, 2018 reply Follow Share @BharathiCH I think you are right it will be 2. 0 votes 0 votes Please log in or register to add a comment.