esp32 multithreading with std::future/promise & std::packaged_task

RichPiano
Posts: 123
Joined: Mon May 18, 2020 2:51 pm

esp32 multithreading with std::future/promise & std::packaged_task

Postby RichPiano » Fri Jan 06, 2023 8:52 am

I'm thinking about using std::future/std::promise and std::packaged_task to facilitate multithreading on the esp32. I get that the abstraction layering between the multitasking functions is as follows:

std::thread
pthread
FreeRTOS tasks

In any case I do need the flexibility to set task priorities as well as stack size. I also noted that espressif offers custom pthread extensions (https://docs.espressif.com/projects/esp ... hread.html) that could do the trick. These add-ons are afaik not available for std::thread however.

How do you suggest I do multitasking that is compatible to the desired functionality? Should I start from the pthread layer using the add-ons or is there a way I could go full portability using std::thread?

Who is online

Users browsing this forum: No registered users and 143 guests