{"id":32617733,"url":"https://github.com/cfnptr/mpmt","last_synced_at":"2026-04-06T17:00:35.667Z","repository":{"id":45465695,"uuid":"315601304","full_name":"cfnptr/mpmt","owner":"cfnptr","description":"Multi-platform multi-threading library, C99 \u003cthreads.h\u003e alternative (mutex, cond, thread, pool)","archived":false,"fork":false,"pushed_at":"2026-04-06T15:01:08.000Z","size":511,"stargazers_count":9,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-06T16:29:15.847Z","etag":null,"topics":["atomic","c","cmake","condition-variable","cpp","cross-platform","library","linux","macos","multi-platform","multi-threading","mutex","open-source","pool","pthreads","thread","ubuntu","windows","winthread"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cfnptr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-11-24T10:47:33.000Z","updated_at":"2026-04-06T15:01:03.000Z","dependencies_parsed_at":"2024-03-09T19:26:57.541Z","dependency_job_id":"bfc743da-3de5-4c7e-9c99-6046e1fa74b9","html_url":"https://github.com/cfnptr/mpmt","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/cfnptr/mpmt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfnptr%2Fmpmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfnptr%2Fmpmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfnptr%2Fmpmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfnptr%2Fmpmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfnptr","download_url":"https://codeload.github.com/cfnptr/mpmt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfnptr%2Fmpmt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31481238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T14:34:32.243Z","status":"ssl_error","status_checked_at":"2026-04-06T14:34:31.723Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["atomic","c","cmake","condition-variable","cpp","cross-platform","library","linux","macos","multi-platform","multi-threading","mutex","open-source","pool","pthreads","thread","ubuntu","windows","winthread"],"created_at":"2025-10-30T17:05:29.281Z","updated_at":"2026-04-06T17:00:35.661Z","avatar_url":"https://github.com/cfnptr.png","language":"C","readme":"# MPMT  \n\nA small [library](https://github.com/cfnptr/mpmt) providing generic interface for **multithreading** across different platforms.\u003cbr/\u003e\nCreated due to the fact that macOS does not support `\u003cthreads.h\u003e` in C11.\n\nSee the [documentation](https://cfnptr.github.io/mpmt).\n\n## Features\n\n* Mutex (Mutual exclusion)\n* Cond (Condition variable)\n* Thread (sleep, yield, etc.)\n* Thread pool (tasks)\n* Atomics (fetch add)\n* Supports Windows, macOS and Linux\n\n## Usage example\n\n```c\nvoid mutexExample()\n{\n    Mutex mutex = createMutex();\n\n    if (!mutex)\n        abort();\n\n    lockMutex(mutex);\n    // Do some synchronized work...\n    unlockMutex(mutex);\n\n    destroyMutex(mutex);\n}\n\n// ========================================\n\nstatic void onUpdate(void* argument)\n{\n    volatile bool* isRunning = argument;\n    \n    while (*isRunning)\n    {\n        // Do some parallel work...\n        sleepThread(0.001);\n    }\n}\n\nvoid threadExample()\n{\n    volatile bool isRunning = true;\n\n    Thread thread = createThread(\n        onUpdate, \u0026isRunning);\n\n    if (!thread)\n        abort();\n\n    isRunning = false;\n    joinThread(thread);\n    destroyThread(thread);\n}\n```\n\n## Build requirements\n\n* C99 compiler\n* C++17 compiler (optional)\n* [Git 2.53+](https://git-scm.com/)\n* [CMake 3.10+](https://cmake.org/)\n\nUse building [instructions](BUILDING.md) to install all required tools and libraries.\n\n### CMake options\n\n| Name                | Description               | Default value |\n|---------------------|---------------------------|---------------|\n| MPMT_BUILD_SHARED   | Build MPMT shared library | `ON`          |\n| MPMT_BUILD_TESTS    | Build MPMT library tests  | `ON`          |\n| MPMT_BUILD_EXAMPLES | Build MPMT usage examples | `ON`          |\n\n### CMake targets\n\n| Name        | Description          | Windows | macOS    | Linux |\n|-------------|----------------------|---------|----------|-------|\n| mpmt-static | Static MPMT library  | `.lib`  | `.a`     | `.a`  |\n| mpmt-shared | Dynamic MPMT library | `.dll`  | `.dylib` | `.so` |\n\n## Cloning\n\n```\ngit clone https://github.com/cfnptr/mpmt\n```\n\n## Building ![CI](https://github.com/cfnptr/mpmt/actions/workflows/cmake.yml/badge.svg)\n\n* Windows: ```./scripts/build-release.bat```\n* macOS / Linux: ```./scripts/build-release.sh```\n\n## Usage\n\nThread example: [examples/thread_example.c](examples/thread_example.c)\u003cbr/\u003e\nMutex example: [examples/mutex_example.c](examples/mutex_example.c)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfnptr%2Fmpmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfnptr%2Fmpmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfnptr%2Fmpmt/lists"}