microsoft / microsoft/vscode-cpptools

Replace pthreads in multithreaded sample with standard C++11 <thread>

Open
#13,732 1 comment 0 reactions 1 assignee View on GitHub

@Subham-KRLX is already working on this.

Since Jun 27, 2025.

bug
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Problem

In PR #13702 it was decided to retain build.cmd for Windows, since that's not actually the root issue. The real limitation is the use of pthreads in the multithreaded sample, which restricts cross-platform compatibility.

Proposal

  • Update the multithreaded example to use C++11 <thread> instead of pthreads
  • Remove direct pthread dependencies in the sample code
  • Adjust build scripts or CMake/Makefiles to avoid needing -pthread
  • Ensure the sample builds and runs consistently on Windows, macOS, and Linux without extra libraries or flags

Benefits

  • Enables true cross-platform support out of the box
  • Simplifies build system and reduces dependency overhead
  • Demonstrates modern C++ best practices in the sample

References:

  • Initial PR & discussion: #13702

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.