{"id":18293711,"url":"https://github.com/laa-1/user-mode-thread","last_synced_at":"2025-04-09T08:17:47.674Z","repository":{"id":229409228,"uuid":"775933601","full_name":"laa-1/user-mode-thread","owner":"laa-1","description":"一个适用于 Linux x86-64 平台的用户态多线程库，支持线程的 create、sleep、join、yield 操作，支持互斥锁、自旋锁、读写锁、条件变量的各类操作。","archived":false,"fork":false,"pushed_at":"2024-07-15T16:30:42.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T02:26:22.796Z","etag":null,"topics":["library","thread","user-mode"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/laa-1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-03-22T10:39:35.000Z","updated_at":"2024-09-05T14:56:01.000Z","dependencies_parsed_at":"2024-07-15T19:44:02.199Z","dependency_job_id":"91f91f6d-ccfa-4139-be7d-c577c16d693c","html_url":"https://github.com/laa-1/user-mode-thread","commit_stats":null,"previous_names":["laa-1/usermodethread","laa-1/user-mode-thread"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laa-1%2Fuser-mode-thread","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laa-1%2Fuser-mode-thread/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laa-1%2Fuser-mode-thread/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laa-1%2Fuser-mode-thread/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laa-1","download_url":"https://codeload.github.com/laa-1/user-mode-thread/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999866,"owners_count":21031046,"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":["library","thread","user-mode"],"created_at":"2024-11-05T14:25:49.904Z","updated_at":"2025-04-09T08:17:47.652Z","avatar_url":"https://github.com/laa-1.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# user-mode-thread 用户态线程\n\n一个适用于 Linux x86-64 平台的用户态多线程库。\n\n支持线程的 create、sleep、join、yield 操作。\n\n支持互斥锁、自旋锁、读写锁、条件变量的各类操作。\n\n## 环境\n\n* Ubuntu 22.04.4 LST x86-64\n* gcc 11.4.0\n\n本项目使用了 _POSIX_SOURCE 宏以及 x86-64 汇编，需要注意平台是否支持。\n\n## 使用\n\nuser_mode_thread.h 头文件中包含了所有的 api。\n\n你可以在 test 目录中查看所有的示例。\n\n```c\n#include \u003cstdio.h\u003e\n#include \"../src/user_mode_thread.h\"\n\nvoid thread1()\n{\n    for (;;)\n    {\n        printf(\"thread1\\n\");\n    }\n}\n\nvoid thread2()\n{\n    for (;;)\n    {\n        printf(\"thread2\\n\");\n    }\n}\n\nint main()\n{\n    thread_main_init();\n    thread_create(thread1, DAFLULT_PRIORITY);\n    thread_create(thread2, DAFLULT_PRIORITY);\n    for (;;)\n    {\n        printf(\"main\\n\");\n    }\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaa-1%2Fuser-mode-thread","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaa-1%2Fuser-mode-thread","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaa-1%2Fuser-mode-thread/lists"}