更换语言:
   Contact us
  • Follow CooCox
  •         
  • CooCox Market
  •         
  • Tech Support
  •     
Home  ›  CoOS › Task Management

Critical Section

     Different from other kernels, CooCox CoOS does not handle the critical code section by closing interrupts, but locking the scheduler. Therefore, CoOS has a shorter latency for interrupt compared with others.

     Since the time of enabling the interrupt relates to system鈥檚 responsiveness towards the real-time events, it is one of the most important factors offered by the real-time kernel developers. By locking the scheduler we can improve system鈥檚 real-time feature to the maximum comparing to other approaches.

     Since CooCox CoOS manages the critical section by forbidding to schedule task, user鈥檚 applications cannot call any API functions which will suspend the current running task in critical sections, such as CoExitTask ( ), CoSuspendTask ( ), CoTickDelay ( ), CoTimeDelay ( ), CoEnterMutexSection ( ), CoPendSem ( ), CoPendMail ( ), CoPendQueueMail ( ), CoWaitForSingleFlag ( ), CoWaitForMultipleFlags ( ) and so on.

Code 7 Critical Section
  • void Task1(void* pdata)
    {
          .....................
          CoSchedLock ( );                                   // Enter Critical Section
          ...............                                         // Critical Code
          CoSchedUnlock ( );                               // Exit Critical Section
          .....................
    }



CooCox CoOS

© 2009 -2011 CooCox - Terms of Use         Business Model         Market             About us