Two processes X and Y need to access a critical section. Consider the following synchronization construct used by both the processes Process ? /* other code for process ? */ while(true) { varP = true; while(varQ == true) { /* Critical Section */ varP = false; } } /* other code for process ?? */   Process ? /* other code for process ? */ while(true) { varQ = true; while(varP == true) { /* Critical Section */ varQ = false; } } /* other code for process ? */   Here, varP and varQ are shared variables and both are initialized to false. Which one of the following statements is true?

Two processes X and Y need to access a critical section. Consider the following synchronization construct used by both the processes Process ? /* other code for process ? */ while(true) { varP = true; while(varQ == true) { /* Critical Section */ varP = false; } } /* other code for process ?? */   Process ? /* other code for process ? */ while(true) { varQ = true; while(varP == true) { /* Critical Section */ varQ = false; } } /* other code for process ? */   Here, varP and varQ are shared variables and both are initialized to false. Which one of the following statements is true? Correct Answer The proposed solution prevents deadlock but fails to guarantee mutual exclusion

[ alt="z,0401" src="//storage.googleapis.com/tb-img/production/17/05/z%2C0401.JPG" style="height:250px; width:279px">

As both processes can enter in critical section at the same time, mutual exclusion is not satisfied.

Related Questions

Each of a set of n processes executes the following code using two semaphores a and b initialized to 1 and 0, respectively. Assume that count is a shared variable initialized to 0 and not used in CODE SECTION P. CODE SECTION P wait (a); count=count+1 ; if (count==n) signal (b) ; signal (a) ; wait (b) ; signal (b) ; CODE SECTION Q What does the code achieve?
A passage is given with five questions following it. Read the passage carefully and select the best answer to each question out of the given fouralternatives. Just as space permeates everything in the universe, love permeates every part, every aspect of creation. If there is one answer to the question, “How and why doesthis world exist?” the answer, in one word, is Love. Rather, the answer is Pure Love, since the word love has lost its meaning. Your very existence is an expression of pure unconditional love of the Source (you may call it Consciousness, Creator, God, Divine Self). This is the truth of your being.True love transcends both love and hatred. It is unconditional, unquestioning, boundless, unchanging love. It is overflowing love of the Source for the Source throughall of creation. True love is way beyond the personalized love that two or more individuals assert on one another. Personalized love, though apparently selfless, is rooted in desiresand conditional satisfaction. We have been brought up in a society that judges love based on conditions. We have been made to believe that we can receive love only when we fit into peoplesexpectations. If we are not good enough, we will be deprived of love. These beliefs have influenced the collective psyche of families, groups, communities, and societies since generations to such an extent that love has been reduced tofear of denial. We need to shift from the paradigm of false conditional love to the essence of pure unconditional love . The experience of true love comes with surrender of the false I, in letting go of the feeling of separateness. Without this sacrifice, it is not possible to attain divinelove. When this separate I is discarded, you embrace everything in oneness and catch a glimpse of pure love. True love can be experienced only through giving, not by demanding. People who exist in your life are not here to love you. They are here to remind you that you arethe Source of Love. By knowing that you are the Source of love, you can love yourself, instead of waiting to receive love from the world. Ask yourself, “Why do I need an agent to love myself?” Waiting for the world to love you, is like hiring an agent to love yourself! It is time for you to honor yourself as the Source of love. You have undertaken this human journey to realize and express the boundless love that you truly are. According to the passage, which of the following statement is not TRUE?
A passage is given with five questions following it. Read the passage carefully and select the best answer to each question out of the given fouralternatives. Just as space permeates everything in the universe, love permeates every part, every aspect of creation. If there is one answer to the question, “How and why doesthis world exist?” the answer, in one word, is Love. Rather, the answer is Pure Love, since the word love has lost its meaning. Your very existence is an expression of pure unconditional love of the Source (you may call it Consciousness, Creator, God, Divine Self). This is the truth of your being.True love transcends both love and hatred. It is unconditional, unquestioning, boundless, unchanging love. It is overflowing love of the Source for the Source throughall of creation. True love is way beyond the personalized love that two or more individuals assert on one another. Personalized love, though apparently selfless, is rooted in desiresand conditional satisfaction. We have been brought up in a society that judges love based on conditions. We have been made to believe that we can receive love only when we fit into peoplesexpectations. If we are not good enough, we will be deprived of love. These beliefs have influenced the collective psyche of families, groups, communities, and societies since generations to such an extent that love has been reduced tofear of denial. We need to shift from the paradigm of false conditional love to the essence of pure unconditional love . The experience of true love comes with surrender of the false I, in letting go of the feeling of separateness. Without this sacrifice, it is not possible to attain divinelove. When this separate I is discarded, you embrace everything in oneness and catch a glimpse of pure love. True love can be experienced only through giving, not by demanding. People who exist in your life are not here to love you. They are here to remind you that you arethe Source of Love. By knowing that you are the Source of love, you can love yourself, instead of waiting to receive love from the world. Ask yourself, “Why do I need an agent to love myself?” Waiting for the world to love you, is like hiring an agent to love yourself! It is time for you to honor yourself as the Source of love. You have undertaken this human journey to realize and express the boundless love that you truly are. Which of the following statement(s) is/are TRUE about pure love?