# GATE (Graduate Aptitude Test in Engineering) Computer Science: Questions 2062 - 2063 of 2080

Access detailed explanations (illustrated with images and videos) to 2080 questions. Access all new questions- tracking exam pattern and syllabus. View the complete topic-wise distribution of questions. Unlimited Access, Unlimited Time, on Unlimited Devices!

View Sample Explanation or View Features.

Rs. 550.00 -OR-

## Question 2062

Appeared in Year: 2020

### Question

MCQ▾

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.

1. `CODE SECTION P`
2. `Wait ( a ) ; count =count +1;`
3. `if ( count==n ) signal ( b ) ;`
4. `signal ( a ) :wait ( b ) ; signal ( b ) ;`
5. `CODE SECTION Q`

What does the code achieve?

### Choices

Choice (4)Response

a.

It ensures that at most n − 1 processes are in CODE SECTION P at any time

b.

It ensures that two processes are in CODE SECTION Q at any time

c.

It ensures that all processes execute CODE SECTION P mutually exclusively

d.

It ensures that no process executes CODE SECTION Q before every process has finished CODE SECTION P

## Question 2063

Appeared in Year: 2020

### Question

MCQ▾

There are multiple routes to reach from node 1 to node 2, as shown in the network.

The cost of travel on an edge between two nodes is given in rupees. Nodes ‘a’ , ‘b’ , ‘c’ , ‘d’ , ‘e’ , and ‘f’ are toll booths. The toll price at toll booths marked ‘a’ and ‘e’ is ₹ 200, and is ₹ 100 for the other toll booths. Which is the cheapest route from node 1 to node 2?

### Choices

Choice (4)Response

a.

1 − a − c − 2

b.

1 − f − b − 2

c.

1 − b − 2

d.

1 − f − e − 2

Developed by: