{"id":60160,"library":"pthreads","title":"Pthreads (pthreads4w on Windows)","description":"Meta-package that provides PThreads4W on Windows, or assumes presence of system pthreads on POSIX systems.","status":"active","version":"3.0.0","language":"cpp","source_language":null,"source_url":null,"tags":["threading","pthreads","posix"],"install":[{"cmd":"vcpkg install pthreads","lang":"bash","label":"vcpkg"},{"cmd":"# CMakeLists.txt\nfind_package(pthreads CONFIG REQUIRED)\ntarget_link_libraries(main PRIVATE pthreads::pthreads)","lang":"cmake","label":"CMake"}],"dependencies":[],"imports":[{"symbol":"pthread.h","correct":"#include <pthread.h>"}],"quickstart":{"code":"#include <pthread.h>\n#include <iostream>\n\nvoid* thread_func(void* arg) {\n  std::cout << \"Hello from thread!\" << std::endl;\n  return nullptr;\n}\n\nint main() {\n  pthread_t thread;\n  pthread_create(&thread, nullptr, thread_func, nullptr);\n  pthread_join(thread, nullptr);\n  return 0;\n}","lang":"cpp","description":"Creating a thread with pthreads"},"warnings":[{"fix":"Test thoroughly on Windows if cross-platform compatibility is needed","message":"On Windows, pthreads4w may have different behavior than POSIX pthreads","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'assum':14 'meta':6 'meta-packag':5 'packag':7 'posix':20,24 'presenc':15 'provid':9 'pthread':1,18,23 'pthreads4w':2,10 'system':17,21 'thread':22 'window':4,12","created_at":"2026-06-16T19:18:45.517331+00:00","updated_at":"2026-06-16T19:18:45.517331+00:00","problems":[],"ecosystem":"vcpkg","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["async"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-12-14","install_tag":null}}