|
| ||||||||||
| Tags: c critical section, c programming, c section, critical section |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Don't know about critical section in c
While referring one C programming book I found one concept known as 'critical section'. I didn't get what does the exact meaning of 'critical section' in C programming. Have you aware about the 'critical section in c'? if yes then please share your knowledge with me so that I can clear my doubts regarding the 'critical section' |
|
#2
| ||||
| ||||
| Re: Don't know about critical section in c
Hi, Critical section in C programming is the some part of code which can be assessable by multiple processes and threads at the single time. This part of program code is get protected by semaphores to avoid the overwriting of similar memory space. When the work over this critical section finishes the semaphore release it so that it cane be used by other processes while updating and reading the memory space. |
|
#3
| ||||
| ||||
| Re: Don't know about critical section in c
In C programming language a critical section is a part of program code and which accesses a shared data structure or device. Critical section can not be accessed by multiple threads while execution of program. The critical section in C normally terminate within fixed amount of period. The Task, process of thread needs to wait for fixed period of time to access the Critical section of C.That is C language has some synchronization mechanism for the use of 'Critical section'. |
|
#4
| ||||
| ||||
| Re: Don't know about critical section in c
Hello Friend, Refer following program for critical section in C. Here I protected two processes from the critical section: Quote:
|
|
#5
| |||
| |||
| Re: Don't know about critical section in c
A critical section in C is normally used when a multithreaded program code try to update multiple c variables which are related to each other without conflicting changes to that particular data. In some conditions 'critical section' can be useful to ensure the resource which are shared. The example of this situation is that a printer could be accessible for only one process at a single time. I hope it will clear you doubts about critical section in c. |
|
#6
| ||||
| ||||
| Re: Don't know about critical section in c critical section in C language is piece of a process which must be indivisibly executed. critical sections must be uninterrupted by particular set of processes.This section must have specific termination time. Sometime the the thread or proceed need to wait for specific amount of time before accessing the critical section in C programming. The overwriting in the critical section is can be avoid by using the semaphores. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Don't know about critical section in c" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hidden section in SSX building Run | Hard.Kaur | Video Games | 6 | 02-03-2012 07:24 PM |
| How to get the new secret section of Limbo? | CAMDEND | Video Games | 5 | 07-08-2011 11:31 PM |
| Server 2003 Critical Patch KB929969=Critical Problems | bpacman | Windows Server Help | 5 | 18-11-2010 07:37 AM |
| Section 2 man pages missing | Xmen | Operating Systems | 3 | 30-11-2009 10:02 AM |
| Lighting section in the photoshop | Nevermind | Customize Desktop | 1 | 12-12-2008 01:30 PM |