Examlex

Solved

Examine the SharedData Class Shown Below

question 64

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 30 milliseconds between calls. Thread two calls getSharedData eight times, also sleeping for 30 milliseconds between calls. What is one reason why thread two may not receive 7 and 8 on its two final calls to getSharedData? public class SharedData
{
Private int value;
Public void setSharedData(int n)
{
Value = n;
}
Public int getSharedData()
{
Return value;
}
}


Definitions:

Proactive Interference

The tendency for previously learned information to hinder the recall of newly learned information.

Long-term Memory

A phase of memory responsible for the storage of information for an extended period, ranging from a few minutes to a lifetime.

Material Interference

In psychology, the effect that the presence of one set of learning material has on the ability to recall or learn another set.

Childhood Amnesia

The phenomenon where early childhood memories, typically before the age of 3 to 4, are not retained into adulthood.

Related Questions