zephyr icon indicating copy to clipboard operation
zephyr copied to clipboard

Support for std::thread and std::this_thread

Open cfriedt opened this issue 5 years ago • 2 comments

Is your enhancement proposal related to a problem? Please describe. It would be nice for C++ applications to be able to use std::thread and std::this_thread.

Describe the solution you'd like To be able to use use std::thread and std::this_thread. I can make a PR.

Describe alternatives you've considered I recently created a PR to provide a sample for and to document the socketpair API (#25528) and was able to get threading working with a couple of defines and implementing std::thread::join().

I also needed nanosleep(2) for std::this_thread::sleep_for()

However, in #25528 it was only partial support for std::thread. There are a couple of additional modes that will need testing. I thought it better to make a separate PR to address C++ threading as a whole.

Additional context Depends on #25559 Depends on #26999 Depends on #25973

cfriedt avatar May 24 '20 12:05 cfriedt

I'd love to have this functionality on Zephyr!

MrMarteng avatar Jun 29 '24 07:06 MrMarteng

@MrMarteng - we are one PR to the zephyr-sdk away. The change that adds C++ threads support was unfortunately reverted as there were a couple of gaps in testing, but you can (IIRC) still download SDK release 0.16.6 which should have the required features.

See https://github.com/zephyrproject-rtos/sdk-ng/issues/751 for more info

cfriedt avatar Jun 29 '24 12:06 cfriedt

I would also love to see this feature on Zephyr. Do we have any ETA of when will this feature be rolled out?

vhouriecosta-sc avatar Jul 16 '24 12:07 vhouriecosta-sc