In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the example analysis of mutex semaphores in vxworks, which is very detailed and has certain reference value. Friends who are interested must finish it!
Multitasking systems are often faced with a problem: resource competition. What are the resources? Many, such as peripherals, files, data and so on. Conflicts occur when multiple tasks access these resources at the same time. For example, the following code
Each time the function myBufPut () is called, a character is stored in the array myBuf [], which is equivalent to a stack operation. In a real system, if there are too many tasks, anything can happen. If this function is called by two tasks (T1 and T2), the following execution sequence may appear.
No sooner had T1 added 1 to myBufIndex than it was preempted by the high-priority T2. Then you must wait for T2 to exit the ready queue before T1 can continue execution. The end result is that nothing is stored in myBuf [0], while myBuf [1] is first stored in 'baked' and then saved in'a'. It can be seen that with only two lines of code, something will go wrong. What if a resource has only one line of code?
The above is all the contents of the article "sample Analysis of mutex semaphores in vxworks". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.