Introduction to Operating Systems Nptel Week 6 Answers

Are you looking for Introduction to Operating Systems Nptel Week 6 Answers? You’ve come to the right place! Access the latest and most accurate solutions for your Week 6 assignment in the Introduction to Operating Systems course.

Course Link: Click Here


These are Introduction to Operating Systems Nptel Week 6 Answers
Introduction to Operating Systems Nptel Week 6 Answers

Introduction to Operating Systems Nptel Week 6 Answers (July-Dec 2024)


1. Which of the following are atomic statements?

i) if(count==0)
ii) add %eax,%ebx

A) i is atomic, ii is non-atomic
B) i is non-atomic, ii is non-atomic
C) i is non-atomic, ii is atomic
D) Both are atomic

Answer: C) i is non-atomic, ii is atomic


2. When a process exiting a critical section calls wakeup(), all the contending processes wake up at once. This is called and can be used to solve this problem. (Choose the option such that the first word is the answer for the first blank, and the second word is for the second blank)

A) Thundering herd problem, Process queue
B) Lost wakeup, Process queue
C) Thundering herd, Semaphores
D) Lost wakeup, Semaphores

Answer: A) Thundering herd problem, Process queue


3. State True/False.

Peterson’s solution is a synchronization mechanism that works for a maximum of two processes.

A) True
B) False

Answer: A) True


4. If the value of a counting semaphore s = 6, then the maximum number of requests for the critical section before it blocks is _?

A) 0
B) 2
C) 4
D) 6

Answer: D)6


5. Which of the following is not an atomic primitive?

A) Test and Set
B) Test-test and set
C) Cmp and swap
D) None of the above

Answer: D) None of the above


These are Introduction to Operating Systems Nptel Week 5 Answers


6. Consider the notation nP and mV to indicate n down operations and m up operations on a semaphore respectively. In a certain application, the initial value of a counting semaphore s is 15. The following operations were completed on the semaphore in the given order: 5P, 8P, 4V, 7P, 6V, 3P, 4V. The new value of the counting semaphore is _?

Answer: 6


7. Consider the notation nP and mV to indicate n down operations and m up operations on a semaphore respectively. For an application using a counting semaphore, the following sequence of operations is obtained: 6P, 3V, 5P, 4V, 8P. The value of the semaphore at the end of these operations is -4. What is the initial value of the semaphore?

Answer: 8


8. State True or False.

If the current value of a counting semaphore s = -2, i.e., the number of processes that can enter the critical section is 2.

A) True
B) False

Answer: B) False


9. Atomic operations like test and set ensure that:

A) They are executed in a single cycle.
B) They can be executed in multiple cycles, no other memory instruction is executed while this instruction is executing.
C) They can be executed in multiple cycles, but no other memory instruction to the same variable is executed while this instruction is executing.
D) No other instructions execute in the background while this instruction is being executed.

Answer: C) They can be executed in multiple cycles, but no other memory instruction to the same variable is executed while this instruction is executing.


10. When the return value of fork() is zero, it indicates the current process is:

A) Parent process
B) Child process
C) Forking failed

Answer: B) Child process


These are Introduction to Operating Systems Nptel Week 6 Answers

All weeks of Introduction to Operating Systems: Click Here

For answers to additional Nptel courses, please refer to this link: NPTEL Assignment Answers


Introduction to Operating Systems Nptel Week 6 Answers (JULY-DEC 2023)

Course Name: Introduction to Operating Systems

Course Link: Click Here

These are Introduction to Operating Systems NPTEL Assignment 6 Answers


Q1. Consider the following statements:
i) if(count==0)
ii) add %eax,%ebx

i is atomic , ii is non-atomic
i is non-atomic , ii is non-atomic
i is non-atomic , ii is atomic
Both are atomic

Answer: i is non-atomic , ii is atomic


Q2. Which of the following condition could occur due to lack of synchronization?
Inconsistency
Loss of data
Deadlock
All of these

Answer: All of these


Q3. Return value of xchg instruction is_____________
Old value
New value
1 if operation succeeds and 0 if operation fails
None of the above

Answer: Old value


These are Introduction to Operating Systems NPTEL Assignment 6 Answers


Q4. By using intel hardware xchg instruction, ensures that
The critical section is deadlock free
Solution is starvation free
Process enters CS in FIFO order
More than one process enters critical section at same time
Which of the above statement is TRUE?

a only
a and b
b and c
d only

Answer: a only


Q5. Your friend wants to design synchronization primitives and tells you that he would be better off by strictly ensuring that the processes alternate the critical section. Your response would be:
That might not satisfy the “progress” requirement
That might not satisfy the “mutual exclusion” requirement
That might not satisfy the “bounded wait” requirement
I guess that would suffice.

Answer: That might not satisfy the “progress” requirement


Q6. State True/False
Bakery algorithm ensures that no process is starved.

True
False

Answer: True


These are Introduction to Operating Systems NPTEL Assignment 6 Answers


Q7. State True/ False
Message passing is slow compared to shared memory and more error prone.

True
False

Answer: False


Q8. Inter process communication with message passing, the shared memory is in
User space
Kernel space
Virtual memory
None of these

Answer: Kernel space


Q9. In a certain application, the initial value of a counting semaphore s is 10. The following operations were completed on the semaphore in the given order 5P, 20P, 2V, 18P, 5V, 10P, 1V. The new value of counting semaphore is ______ ?

Answer: -35


These are Introduction to Operating Systems NPTEL Assignment 6 Answers


Q10. If the value of a counting semaphore s = 4, then the maximum number of requests for the critical section before it blocks is _____?
0
1
2
4

Answer: 4


Q11. State True/False
It is possible to share the messages even without attaching the shared memory with the address space of calling process.

True
False

Answer: False


Q12. The variable turn can have values 0 or 1

Void Process (i)
 {
 while(1)
    {
      //Non-critical section
       While (turn!=i);
            //     Critical section
        turn = j;
    }
}

The above code does not provide
Mutual exclusion
Progress
Bounded wait
None of these

Answer: Progress


These are Introduction to Operating Systems NPTEL Assignment 6 Answers


Q13. Test and Set instruction, which provides hardware synchronization does not guarantee ________.
Mutual exclusion
Progress
Bounded wait
None of these

Answer: Bounded wait


Q14. Peterson’s solution is a synchronization mechanism for maximum of _____ processes.

Answer: 2


Q15. Atomic operations like test&set ensure that
They are executed in a single cycle
They can be executed in multiple cycles,no other memory instruction is executed while this instruction is executing
They can be executed in multiple cycles,but no other memory instruction to the same variable is executed while this instruction is executing
No other instructions execute in the background while this instruction is being executed

Answer: They can be executed in multiple cycles,but no other memory instruction to the same variable is executed while this instruction is executing


These are Introduction to Operating Systems NPTEL Assignment 6 Answers

More Weeks of Introduction to Operating Systems: Click here

More Nptel Courses: Click here


These are Introduction to Operating Systems NPTEL Assignment 6 Answers