refactor(samples): replace pthreads with std::thread in multithreaded sample
This PR addresses issue #13732 by refactoring the multithreaded sample to use C++11
✅ Highlights:
- Replaced platform-specific pthread code with std::thread
- Improved thread safety using atomic operations
- Updated Makefile to reflect C++11 changes
- Validated build on macOS and ensured cross-platform compatibility
@sean-mcmanus All requested changes are now complete:
- Removed all pthread dependencies
- Deleted unnecessary config files
- Verified thread safety and execution Ready for your final review.
Hi @sean-mcmanus, All requested changes have been addressed:
Fully migrated from pthreads to std::thread Cleaned up unneeded config files Improved thread safety, verified cross-platform build Updated tasks.json and Makefile for C++11 All checks are passing, and the PR is ready for your final review.
Please let me know if anything else is needed!
Reverted all changes to Extension/.vscode/tasks.json as requested. The PR now only includes the sample refactor. Ready for review!
@sean-mcmanus confirmation:
-
Extension/.vscode/tasks.jsonis now identical tomain@76b0fac(verified via hash check) - All pthread dependencies removed from Fib sample
- Zero unintended changes remain
This PR now contains:
- std::thread migration in Fib sample
- Removed VS/pthread-related files
- Clean cross-platform builds
@sean-mcmanus To clarify:
-
Extension/.vscode/tasks.jsonremains unchanged (matches main@76b0fac) - The modified
Code Samples/Fib/.vscode/tasks.jsonis:- Specific to the Fib sample build
- Properly updated for the std::thread migration
- Contains only Fib-related build configurations
Hi @sean-mcmanus, All the requested changes especially around Extension/.vscode/tasks.json and the full std::thread migration, are now pushed.
@Subham-KRLX We've been busy -- we'll try to review this next week.
@Colengms I have made all the changes you suggested Fixed the build.cmd issue and removed the Makefile since it wasn't needed. Switched those volatile variables to atomic and got rid of the srand call. Also cleaned up that empty thread naming function and simplified the whole test counting thing like you recommended.