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
The 21H function and the 22H function of the 21H interruption are the ones in charge of realizing the random readings and writings in that order. The random register number and the


#to determine whether given year is leap year or not

The main components of a computer system at a basic level Computer System We call computer system to the whole configuration of a computer, as well as the peripheral units and the

Word Processing Software : The main use for word processing is found in secretarial offices and small publishing companies. However, if you are involved in generating your own cor

Suppose that of 100 computers checked for viruses 30 where infected and 70 where not. If we select 10 computers at random what is the probability that at most 4 of them are infecte

classify computer system according to capacity. how they are different from computer according to the classification of technology.provide the comparative study also.

what is CAI? explain its pitfalls.

Input unit: These are used to read data and transfer to primary memory contained in CPU through keyboard or floppy disk or mouse etc. Central Processing Unit (CPU): This consists o

Program Planning (Preparation of a Flow Chart) A flow chart is a graphic method for indicating a proposed or actual solution to the problem. A flow chart shows the steps a comp