How to avoid race conditions with critical section?, Basic Computer Science


• The key to preventing problem involving shared storage is get some way to prohibit more than one process from reading and writing the shared data concurrently. That part of the program where the shared memory is used is called the Critical Section. To keep away from race conditions and flawed outcomes, one must identify codes in Critical Sections in each thread. The feature properties of the code that form a Critical Section are:
o Codes that position one or more variables in a “read-update-write” fashion while some of those variables is probably being changed by another thread.
o Codes that alter one or more variables that are possibly being mentioned in “read-update-write” fashion by another thread.
o Codes use a data structure while any division of it is possibly being altered by another thread.
o Codes alter any division of a data structure while it is possibly in use by an additional thread.

Here, the significant point is that when one process is executing shared adaptable data in its critical section, no further process is to be allowed to execute in its critical section. Therefore, the execution of critical sections by the processes is mutually exclusive in moment.
Posted Date: 5/2/2012 9:08:27 AM | Location : United States







Related Discussions:- How to avoid race conditions with critical section?, Assignment Help, Ask Question on How to avoid race conditions with critical section?, Get Answer, Expert's Help, How to avoid race conditions with critical section? Discussions

Write discussion on How to avoid race conditions with critical section?
Your posts are moderated
Related Questions
Ask qu The figure below shows a rooted tree, 756_Find the height.png 1.1. Find the height/level of the tree as shown above?estion #Minimum 100 words accepted#

Conditional constructs are used to integrate decision making into programs. The outcome of this decision making determines the series in which a program will execute instructions.

types of computer on the basis of shape, size & resources

Question 1 List down any six features of a Smartphone Question 2 Give a brief note on a) Internal Flash Disk. b) Use of C++ in Symbian OS Question 3 What are the naming

#questionWrite a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two poi

Program and Programming Language : A Program is defined as a collection of statements/ instructions that enable the computer to solve a problem. The process of writing a prog

#questioPurpose of this assignment: 1. Using dictionaries. Assignment: Write a program to read a text file and create a dictionary. The keys for the dictionary should be all

158.254 Software Development Lifecycle Management Assignment 1 This assignment focuses on requirements engineering. The context to this assignment is the development of a system

Question 1 Classify and explain the different types of computers Question 2 List and explain the commonly used input devices Question 3 What is binary number system? Exp

I need to create mulitple queues assignment that run concurrently. It is like a queue simulation with  number of checkouts with a random probability of clients, joining any one