Machine-translated by Google. Questions are authored in English.
Top

Inter Task Communication Questions and Answers

Answer: A

Taking it decrements the count and blocks at zero; giving it increments the count and may release a waiter. Three identical buffers or four channels of a converter are the natural cases, the count being initialised to the number available.

Please log in or register to report this question.

Answer: B

Being limited to zero or one makes it a flag, and its two ordinary uses are signalling that something has happened and standing in for a lock. Used as a lock it lacks ownership, which is what distinguishes it from a mutex.

Please log in or register to report this question.

Answer: C

Correct answer: wait and signal, or take and give

Dijkstra’s original names were P and V, from the Dutch, and modern kernels use wait and signal or take and give. Whatever they are called the pair does the same thing: one decrements the count and blocks if it cannot, the other increments it and releases a waiter.

Please log in or register to report this question.

Answer: D

The count remembers the event, so a task that waits later returns at once. A binary semaphore already at one, however, does lose the second signal, which is why a counting semaphore is wanted where events may arrive faster than they are consumed.

Please log in or register to report this question.

Answer: A

Correct answer: once, two of the three signals having been lost

A binary semaphore holds a single bit, so signalling it when it is already signalled changes nothing. Two of the three events are lost. A counting semaphore would have recorded all three, which is exactly the case counting semaphores exist for.

Please log in or register to report this question.

Answer: B

Ownership is what lets the kernel apply priority inheritance and what makes releasing another task's lock an error rather than a legal operation. A semaphore has no owner, which is exactly why it suits signalling between two different tasks.

Please log in or register to report this question.

Answer: C

Correct answer: a semaphore or a task notification

Both are safe to give from an interrupt handler, and both simply wake the task without blocking the handler. A mutex must not be used, since it has an owner and an interrupt has no task identity, and a polled shared variable wastes processor time and adds latency.

Please log in or register to report this question.

Answer: D

The kernel counts the acquisitions and releases the lock only when the count returns to zero, which lets a locked function call another that locks the same resource. It hides a structural problem as often as it solves one.

Please log in or register to report this question.

Answer: A

Correct answer: a count that may be initialised above one

A mutex is a lock and is binary by nature: held or free, with an owner. The count above one belongs to the counting semaphore. Ownership is what gives the mutex its other properties - priority inheritance, and the error on release by a task that does not hold it.

Please log in or register to report this question.

Answer: B

Correct answer: the first statement is true and the second is false

A binary semaphore can certainly be used as a lock, and often is. What it does not do is record who took it, so it cannot support priority inheritance and cannot detect a release by the wrong task. Those are precisely the reasons a mutex exists as a separate object.

Please log in or register to report this question.

Loading…
Tags: Inter Task Communication Questions and Answers || Inter Task Communication MCQ Questions and Answers || Inter Task Communication GK Questions and Answers || Inter Task Communication GK MCQ Questions || Inter Task Communication Multiple Choice Questions and Answers || Inter Task Communication GK || GK on Inter Task Communication || Embedded Systems Questions and Answers || Embedded Systems MCQ Questions and Answers || Embedded Systems GK Questions and Answers || GK on Embedded Systems