{"id":18985176,"url":"https://github.com/potatomaster101/prethread","last_synced_at":"2025-09-17T20:24:30.787Z","repository":{"id":115197735,"uuid":"205617988","full_name":"PotatoMaster101/prethread","owner":"PotatoMaster101","description":"Simple pre-threading","archived":false,"fork":false,"pushed_at":"2021-11-26T12:47:03.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-21T09:48:48.065Z","etag":null,"topics":["c99","mit-license","threading","threads"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PotatoMaster101.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":"2019-09-01T02:09:22.000Z","updated_at":"2020-08-19T12:44:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"15831e50-3fbe-4ec5-b038-2b2dde388b7c","html_url":"https://github.com/PotatoMaster101/prethread","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PotatoMaster101/prethread","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMaster101%2Fprethread","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMaster101%2Fprethread/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMaster101%2Fprethread/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMaster101%2Fprethread/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PotatoMaster101","download_url":"https://codeload.github.com/PotatoMaster101/prethread/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMaster101%2Fprethread/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275658096,"owners_count":25504774,"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","status":"online","status_checked_at":"2025-09-17T02:00:09.119Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["c99","mit-license","threading","threads"],"created_at":"2024-11-08T16:24:59.132Z","updated_at":"2025-09-17T20:24:30.750Z","avatar_url":"https://github.com/PotatoMaster101.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pre-Thread\nSimple POSIX threads pre-threading in C99. Originally used in uni assignments.\n\n## Compile\nCompile with `-lpthread` flag.\n```\ngcc *.c -lpthread -std=c99\n```\n\n## Example\n```c\n#include \u003cstdio.h\u003e\n#include \u003cunistd.h\u003e\n#include \"prethd.h\"\n\nprethd_t *pool = NULL;\n\nvoid *print(void *arg) {\n    prethd_lock(pool, 0);       // locks first (and only) mutex\n    fputc('H', stdout);\n    fputc('e', stdout);\n    fputc('l', stdout);\n    fputc('l', stdout);\n    fputc('o', stdout);\n    fputc(' ', stdout);\n    fputc('W', stdout);\n    fputc('o', stdout);\n    fputc('r', stdout);\n    fputc('l', stdout);\n    fputc('d', stdout);\n    fputc('!', stdout);\n    fputc('\\n', stdout);\n    prethd_unlock(pool, 0);     // unlocks first (and only) mutex\n    sleep(5);\n    return NULL;\n}\n\nint main(void) {\n    const size_t NUM_TH = 50;       // number of threads\n    const size_t NUM_MUT = 1;       // number of mutexes\n    const size_t NUM_COND = 0;      // number of conditional variables\n\n    pool = prethd_new(NUM_TH, NUM_MUT, NUM_COND);\n    prethd_all(pool, print, NULL);\n    prethd_join_free(pool);\n    printf(\"Done\\n\");\n    return 0;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotatomaster101%2Fprethread","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpotatomaster101%2Fprethread","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotatomaster101%2Fprethread/lists"}