nerdexam
Oracle

1Z0-804 · Question #103

Sam has designed an application. It segregates tasks that are critical and executed frequently from tasks thatare non critical and executed less frequently. He has prioritized these tasks based on…

The correct answer is B. starvation. Starvation describes a situation where a thread is unable to gain regular access to sharedresources and is unable to make progress. This happens when shared resources are made unavailable forlong periods by "greedy" threads. For example, suppose an object provides a…

Concurrency

Question

Sam has designed an application. It segregates tasks that are critical and executed frequently from tasks thatare non critical and executed less frequently. He has prioritized these tasks based on their criticality andfrequency of execution. After close scrutiny, he finds that the tasks designed to be non critical are rarely gettingexecuted. From what kind of problem is the application suffering?

Options

  • Arace condition
  • Bstarvation
  • Cdeadlock
  • Dlivelock

How the community answered

(37 responses)
  • A
    5% (2)
  • B
    78% (29)
  • C
    3% (1)
  • D
    14% (5)

Explanation

Starvation describes a situation where a thread is unable to gain regular access to sharedresources and is unable to make progress. This happens when shared resources are made unavailable forlong periods by "greedy" threads. For example, suppose an object provides a synchronized method that oftentakes a long time to return. If one thread invokes this method frequently, other threads that also need frequentsynchronized access to the same object will often be blocked.

Topics

#starvation#thread priority#task scheduling#concurrency problems

Community Discussion

No community discussion yet for this question.

Full 1Z0-804 Practice