question about thread priority
Posted: Fri Mar 28, 2014 9:37 am
Hi all,
I'm new to multithread programming and would like to ask some basic questions while using ChibiOS.
I need to design my software like this: Thread A is running initially, but before it finishes the process, an interrupt comes in and wake up Thread B . However, I hope to let Thread A finish its process first before Thread B starts running. In this case, what kind of feature in ChibiOS shall I use? Would it be achieved if I give Thread A a higher priority? Or the mutex feature?
Another occasion is that, what if the interrupt comes in twice while Thread A is still running, would it wake up Thread B twice as well? What could happen to the shared resource?
Hope someone could help.
Thanks a lot,
Shan
I'm new to multithread programming and would like to ask some basic questions while using ChibiOS.
I need to design my software like this: Thread A is running initially, but before it finishes the process, an interrupt comes in and wake up Thread B . However, I hope to let Thread A finish its process first before Thread B starts running. In this case, what kind of feature in ChibiOS shall I use? Would it be achieved if I give Thread A a higher priority? Or the mutex feature?
Another occasion is that, what if the interrupt comes in twice while Thread A is still running, would it wake up Thread B twice as well? What could happen to the shared resource?
Hope someone could help.
Thanks a lot,
Shan