What is Critical section?

Answer Posted / guest

A critical section of code is one in which data that may be
accessed by other threads are inconsistent. At a higher
level, a critical section can be viewed as a section of
code in which a guarantee you make to other threads about
the state of some data may not be true.
If other threads can access these data during a critical
section, your program may not behave correctly. This may
cause it to crash, lock up, produce incorrect results, or
do just about any other unpleasant thing you care to
imagine.

Other threads are generally denied access to inconsistent
data during a critical section (usually through use of
locks). If some of your critical sections are too long,
however, it may result in your code performing poorly

Is This Answer Correct ?    53 Yes 45 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is critical section?

555


Explain the different kinds of threads?

608


Explain what are threads?

633


Explain what are the main families of threads?

572


Explain the performance differences between user-space threads and kernel-supported threads.?

600






Explain what is protection boundary?

574


Explain how to work unix commands on windows xp without installing unix o/s in pc?

488


How to work unix commands on windows xp without installing unix o/s in pc?

522


List the system calls used for process management?

621


How would you kill a process?

632


What is the working set of a process?

604


Explain what is scheduling?

611


explain about the initial process sequence while the system boots up?

614


Explain critical section?

610


What is protection boundary?

684