-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add c++ std::thread wrapper layer #8
Comments
The biggest issue with the std::thread class is that the constructor doesn't provide the needed information to create a FreeRTOS thread. There is no way to specify anything like a priority or a stack side. It might be possible another project, but this project is designed to be a thin wrapper that keeps most of the features of FreeRTOS available. std::thread is designed to be a least common denominator interface. |
We can overload I believe the biggest challenge is to implement |
is it possible or it's too hard to implement |
It isn't impossible, but it would be in no way trivial. First, it would require adding a semaphore to the Task object that gets set when the task ends (so join doesn't need to go into a polling loop). Next you would need to somehow implement a link from the actual FreeRTOS TCB to the Task structure, and use one of the trace hooks so that on the termination of the task, that semaphore actually gets set. Also, std::thread could only represent a dynamic memory created task, not a static task, at least not with the same method that my Task class uses, as the Task class in not move constructable, since the TCB and stack for static allocated classes is in the object, and that isn't movable. An implemetation of std::thread would need to have just a pointer to a Task class or a task handle in it, to allow the move. |
No description provided.
The text was updated successfully, but these errors were encountered: