Examlex

Solved

Examine the SharedData Class Shown Below

question 36

Multiple Choice

Examine the SharedData class shown below.Suppose two threads are created so that each has access to the same SharedData object.Thread one calls setSharedData eight times with values 1...8 respectively, sleeping for 100 milliseconds between calls.Thread two calls getSharedData eight times, also sleeping for 100 milliseconds between calls.Which of the following could be the last two values received by thread two? Examine the SharedData class shown below.Suppose two threads are created so that each has access to the same SharedData object.Thread one calls setSharedData eight times with values 1...8 respectively, sleeping for 100 milliseconds between calls.Thread two calls getSharedData eight times, also sleeping for 100 milliseconds between calls.Which of the following could be the last two values received by thread two?    A) 9, 10 B) 10, 9 C) 1, 2 D) 8, 7


Definitions:

Tang Dynasty

A dynasty in China (618-907 AD) known for its cultural, artistic, and intellectual advancements, as well as its cosmopolitan capital, Chang'an.

Zen Simplicity

An aesthetic and philosophical concept emphasizing minimalism, naturalness, and intuitive understanding, rooted in Zen Buddhism.

Unified Silla Kingdom

A Korean state that existed from 668 to 935 AD, known for unifying the Korean Peninsula and its cultural achievements.

Sesshu Toyo

A notable Japanese painter and Zen monk from the 15th century, renowned for his ink landscapes.

Related Questions