{"id":20579782,"url":"https://github.com/taskflow/work-stealing-queue","last_synced_at":"2025-04-06T12:08:35.149Z","repository":{"id":47124320,"uuid":"239079026","full_name":"taskflow/work-stealing-queue","owner":"taskflow","description":"A fast work-stealing queue template in C++","archived":false,"fork":false,"pushed_at":"2024-02-01T10:50:00.000Z","size":1038,"stargazers_count":305,"open_issues_count":2,"forks_count":39,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-30T10:09:05.165Z","etag":null,"topics":["multithreading","parallel-computing","parallel-programming","work-stealing"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taskflow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-08T06:10:18.000Z","updated_at":"2025-03-18T15:04:03.000Z","dependencies_parsed_at":"2024-12-24T07:11:27.014Z","dependency_job_id":"260a2da3-3520-4f43-9125-6c39010604e6","html_url":"https://github.com/taskflow/work-stealing-queue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskflow%2Fwork-stealing-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskflow%2Fwork-stealing-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskflow%2Fwork-stealing-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskflow%2Fwork-stealing-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taskflow","download_url":"https://codeload.github.com/taskflow/work-stealing-queue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478323,"owners_count":20945266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["multithreading","parallel-computing","parallel-programming","work-stealing"],"created_at":"2024-11-16T06:18:36.107Z","updated_at":"2025-04-06T12:08:35.125Z","avatar_url":"https://github.com/taskflow.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Work-Stealing Queue\n\nA fast single-header work-stealing queue template written in modern C++17\n\n# How to Use\n\nA work-stealing queue enables one thread (queue owner) to \npush/pop items into/from one end of the queue,\nand multiple threads (thieves) to steal items from the other end.\nThe following example\nshows the basic use of [wsq.hpp](wsq.hpp).\n\n```cpp\n// work-stealing queue of integer numbers\nWorkStealingQueue\u003cint\u003e queue;\n\n// only one thread can push and pop items from one end\nstd::thread owner([\u0026] () {\n  for(int i=0; i\u003c100000000; i=i+1) {\n    queue.push(i);\n  }\n  while(!queue.empty()) {\n    std::optional\u003cint\u003e item = queue.pop();\n  }\n});\n\n// multiple threads can steal items from the other end\nstd::thread thief([\u0026] () {\n  while(!queue.empty()) {\n    std::optional\u003cint\u003e item = queue.steal();\n  }\n});\n\nowner.join();\nthief.join();\n```\n\nThe library is a single header file. \nSimply compile your source with include path to [wsq.hpp](wsq.hpp).\n\n# Compile Examples and Unittests\n\nWe use cmake to manage the package. We recommand using out-of-source build:\n\n```bash\n~$ mkdir build\n~$ cd build\n~$ cmake ..\n~$ make \u0026 make test\n```\n\n# Technical Details\n\nThis library implements the work-stealing queue algorithm\ndescribed in the paper, \n\"[Correct and Efficient Work-Stealing for Weak Memory Models](references/ppopp13.pdf),\" \npublished by Nhat Minh Lê, \nAntoniu Pop, Albert Cohen, and Francesco Zappa Nardelli\nat 2013 ACM Principles and Practice of Parallel Programming (PPoPP).\n\n# Robustness\n\nThis library is part of the \n[Cpp-Taskflow](https://github.com/cpp-taskflow/cpp-taskflow)\nproject.\nIt has experienced thousands of tests in both micro-benchmarks\nand large-scale real-world parallel applications.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaskflow%2Fwork-stealing-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaskflow%2Fwork-stealing-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaskflow%2Fwork-stealing-queue/lists"}