Question

In: Computer Science

What is A- Atomic Action B- Critical Section . in OS in your own words with...

What is

A- Atomic Action

B- Critical Section .

in OS

in your own words with examples.

Solutions

Expert Solution

A) Atomic Action

Atomic operations in concurrent programming are program operations that run completely independently of any other processes.

Atomic operations are used in many modern operating systems and parallel processing systems.

Atomic operations are often used in the kernel, the primary component of most operating systems. However, most computer hardware, compilers and libraries also provide varying levels of atomic operations.

In loading and storing, computer hardware carries out writing and reading to a word-sized memory. To fetch, add or subtract, value augmentation takes place through atomic operations. During an atomic operation, a processor can read and write a location during the same data transmission. In this way, another input/output mechanism or processor cannot perform memory reading or writing tasks until the atomic operation has finished.

Where data is being used by an atomic operation that is also in use by other atomic or non-atomic operations, it can only exist in either sequential processing environments or locking mechanisms have to be used to avoid data errors. Compare and swap is another method but does not guarantee data integrity for atomic operation results.

The problem comes when two operations running in parallel (concurrent operations) utilise the same data and a disparity between the results of the operations occurs. Locking locks variable data and forces sequential operation of atomic processes that utilize the same data or affect it in some way.

B) Critical section

The critical section is a code segment where the shared variables can be accessed. An atomic action is required in a critical section i.e. only one process can execute in its critical section at a time. All the other processes have to wait to execute in their critical sections.

A diagram that demonstrates the critical section is as follows −

In the above diagram, the entry section handles the entry into the critical section. It acquires the resources needed for execution by the process. The exit section handles the exit from the critical section. It releases the resources and also informs the other processes that the critical section is free.

Solution to the Critical Section Problem

The critical section problem needs a solution to synchronize the different processes. The solution to the critical section problem must satisfy the following conditions −

  • Mutual Exclusion

    Mutual exclusion implies that only one process can be inside the critical section at any time. If any other processes require the critical section, they must wait until it is free.

  • Progress

    Progress means that if a process is not using the critical section, then it should not stop any other process from accessing it. In other words, any process can enter a critical section if it is free.

  • Bounded Waiting

    Bounded waiting means that each process must have a limited waiting time. Itt should not wait endlessly to access the critical section.

Note: Plzzz don' t give dislike.....Plzzz comment if u have any problem i will try to resolve it.......


Related Solutions

In your own words describe what is taking place during an action potential. Be sure to...
In your own words describe what is taking place during an action potential. Be sure to include the following terms: sodium ions Na+, potassium ions K+, Threshold, depolarization, repolarization, hyperpolarization, voltage gates. This is not an exhaustive list, you will need to use additional terms when necessary.  
Explain in your own words the working of scanning electron microscope and Atomic Force microscope. In...
Explain in your own words the working of scanning electron microscope and Atomic Force microscope. In two paragraphs one for each. Include references if used.
In your own words, what is an effect size? Discuss how the a) mean, and b)...
In your own words, what is an effect size? Discuss how the a) mean, and b) standard deviation affect effect size.
1- a) What is the importance of liquidity? USE YOUR OWN WORDS       b) List and...
1- a) What is the importance of liquidity? USE YOUR OWN WORDS       b) List and briefly describe the five categories of business ratios. USE YOUR OWN WORDS
In your own words, explain the critical differences between the forward, the futures, and the options...
In your own words, explain the critical differences between the forward, the futures, and the options markets. What advantages does a futures market offer that is not available in a forward market? What advantages does a forward market offer that is not available in a futures market? What advantages does an options market offer over a forward or a futures market?
Respond to the following: Explain properties of atomic nuclei. Explain nuclear stability. In your own words,...
Respond to the following: Explain properties of atomic nuclei. Explain nuclear stability. In your own words, explain α-decay, β-decay, and γ-decay, and give examples. In your own words, explain nuclear fission and fusion.
Anwser in your own words Describe in your own words, what should be included in health...
Anwser in your own words Describe in your own words, what should be included in health record documentation best practices. Provide at least one example of how HIM's ensure these best practices are met.
In your own words Describe the events that take place during an action potential. Begin at...
In your own words Describe the events that take place during an action potential. Begin at the point where an EPSP reaches threshold in the trigger zone. Include all ion channels (8), ion movements (8) and potential changes (8) that take place during the various phases of the action potential.
a.   Write out in your own words what the van der Waals a and b parameters...
a.   Write out in your own words what the van der Waals a and b parameters represent. b.   Rank in increasing order the van der Waals a and b parameters for the following four gases: Hydrogen, Benzene, Ethanol, and Ethane. Check your intuition by looking up these values and explaining the observed trends in a and b.
A) What is the difference between testing μd andμ1 = μ2? (In your own words.) B)...
A) What is the difference between testing μd andμ1 = μ2? (In your own words.) B) What does it mean to have a linear correlation and what does it mean to have a non- linear correlation? C) Describe the error: Given: The linear correlation coefficient between scores on a math test and scores on a test of athletic ability is negative and close to zero. Conclusion: People who score high on the math test tend to score lower on the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT