Reputation: 99
I am currently developing with a cooperative scheduler (e.g., uC/OS-II) and have encountered a problem. The specific scenario is as follows:
One thread is a producer, and the other thread is a consumer. To access critical sections, I have been using the method of disabling interrupts for thread synchronization. During the development process, I found that disabling interrupts does not meet the performance requirements for high real-time applications. The thread synchronization in my code involves at most communication between two threads.
My questions are:
1.In this scenario, is it still necessary to use thread synchronization mechanisms (e.g., disabling interrupts, semaphores, mutexes)?
2.If not using disabling interrupts, is there a better method that can meet real-time requirements without causing data contention?
Thank you very much for your guidance and suggestions!
Upvotes: 1
Views: 62