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
Regardless of of the fact that a thread must execute in process, the process and its associated threads are different notion. Processes are used to group resources together and thr

Here are the more specific requirements and the related points - use the below as a check-off list when you make your presentation.  Please note . . . many of the requirements are

the chemical reactions in a battery produce ____________, each of which carries energy.

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

Question: a) Illustrate, in detail, what is virtual memory? b) The Memory Management Unit is responsible for the translation of virtual addresses to their corresponding phy


DESIGNING COMPUTER BASED INFORMATION SYSTEMS Background The role of Management Information Systems (MIS) in an organization can be considered as providing

how will a poorly conducted feasibility study affect an implemented system

EVOLUTION OF A COMPUTER: Although 'computer', as we understand it today, is relatively of recent innovation, its development rests on centuries' of research. This section pres

Packet Switching: This is one of recent techniques of switching. Packet switching was originally developed for use by ARPA network by the Defence Department of US. According t