I will have a linux service that waits messages from a central and let the tasks do that are ordered by those messages. I think to do is I need to create a new thread.
Moreover, one task would have an absolute priority compared to others and when the order for that task comes, I need to accomplish it as soon as possible. Also, since all these stuff is on embedded system and resources are restricted, I thought I need to pause all other threads that were created.
I imagine that I need some thing similar as here:
How to sleep or pause a PThread in c on Linux
But the question is not duplicate. I do not have exact point to pause threads. I need to pause them wherever possible, and continue when the prioritized task is finished.
And here it suggests a way that seems obsolete and also I could use std::thread.
How to pause a pthread ANY TIME I want?
- How could I achieve prioritize one task?
- (Maybe before that) To do tasks, do I need to design some thing like "Thread manager", or there could be simpler thoughts?
Note: I have used the word "task" as it is, not as a technical term.
Aucun commentaire:
Enregistrer un commentaire