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
Question Elaborate the various steps in performing a Mail Merge. Perform one mail merge operation for sending invitation for a conference which is being conducted in your organ


QUESTION We wish to use the Kaiser window method to design a discrete-time filter with generalized linear phase that meets specifications of the following form:

1. What actions need to be taken when a program terminates or a process is killed? What if that process destruction is not the consequence of normal termination, but rather is the

i have attached all files in zip folder, all files are given and act as headers, all what you need to work on: oaa.h "partially given" , wordbench2.h "needed", wordbench2.cpp "nee

Question 1 What are the various steps involved in pre-production design? Question 2 What are the different kinds of perspectives used in a layout? Question 3 Descr

Evolution of ERP  The origin of using computers for business, traces the following line of story. Originally, they were designed to support the repetitive and time consuming fu

grades computation

Purpose of Code This is a short program to practice assembly language loops and if/else statements. You will use various jump commands and the cmp instruction.  The progra

Problem 1. Explain the different categories of instructions. Explanation of 4 categories 2. Explain the steps to be followed for the addition of floating point numb