{"id":13730132,"url":"https://github.com/paladin-t/fiber","last_synced_at":"2025-07-29T02:31:59.736Z","repository":{"id":77919304,"uuid":"111065417","full_name":"paladin-t/fiber","owner":"paladin-t","description":"A header only cross platform wrapper of fiber API.","archived":false,"fork":false,"pushed_at":"2018-05-22T11:18:38.000Z","size":416,"stargazers_count":45,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-14T20:39:37.790Z","etag":null,"topics":["coroutine","fiber"],"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/paladin-t.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}},"created_at":"2017-11-17T06:13:44.000Z","updated_at":"2024-10-27T12:52:16.000Z","dependencies_parsed_at":"2023-02-25T20:30:26.176Z","dependency_job_id":null,"html_url":"https://github.com/paladin-t/fiber","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/paladin-t%2Ffiber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paladin-t%2Ffiber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paladin-t%2Ffiber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paladin-t%2Ffiber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paladin-t","download_url":"https://codeload.github.com/paladin-t/fiber/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227971922,"owners_count":17849421,"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":["coroutine","fiber"],"created_at":"2024-08-03T02:01:10.330Z","updated_at":"2024-12-03T18:13:36.347Z","avatar_url":"https://github.com/paladin-t.png","language":"C","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"## Fiber\r\n\r\n**Header only cross platform wrapper of fiber API**\r\n\r\nA [fiber](https://en.wikipedia.org/wiki/Fiber_(computer_science)) is a particularly lightweight thread of execution. Which is useful for implementing coroutine, iterator, lightweight thread, etc.\r\n\r\n### How to use\r\n\r\nJust `#include \"fiber.h\"` before using this library.\r\n\r\nThere are quite few interfaces:\r\n\r\n~~~~~~~~~~c\r\nFBAPI static bool_t fiber_is_current(const fiber_t* const fb);\r\nFBAPI static fiber_t* fiber_create(fiber_t* primary, size_t stack, fiber_proc run, void* userdata);\r\nFBAPI static bool_t fiber_delete(fiber_t* fb);\r\nFBAPI static bool_t fiber_switch(fiber_t* fb);\r\n~~~~~~~~~~\r\n\r\nRead comments [in code](fiber.h) to get the usage, or start with a simple [example](test.c).\r\n\r\n### Dependency/Backend\r\n\r\n* Windows backend with [`fiber` functions](https://msdn.microsoft.com/en-us/library/windows/desktop/ms684847(v=vs.85).aspx#fiber_functions)\r\n* POSIX backend with [`setcontext` functions](https://en.wikipedia.org/wiki/Setcontext)\r\n* JavaScript backend with [`asyncify` functions](http://kripken.github.io/emscripten-site/docs/api_reference/emscripten.h.html#asyncify-functions)\r\n\r\n### Drafting\r\n\r\nThis library is supposed to be cross platform as possible. However it's drafting because I've only implemented and tested it on Windows, POSIX and JavaScript platforms. Supporting for more platforms will be added in the future; any pull requests are welcome.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaladin-t%2Ffiber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaladin-t%2Ffiber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaladin-t%2Ffiber/lists"}