{"id":37581798,"url":"https://github.com/firejox/fjx-fiber","last_synced_at":"2026-01-16T09:40:12.784Z","repository":{"id":154156486,"uuid":"630095586","full_name":"firejox/fjx-fiber","owner":"firejox","description":"thread safe stackful coroutine library","archived":false,"fork":false,"pushed_at":"2024-04-18T01:33:14.000Z","size":131,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-18T02:36:54.132Z","etag":null,"topics":["concurrency","coroutine-library","coroutines","csp","fiber","fibers","stackful-coroutines"],"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/firejox.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}},"created_at":"2023-04-19T16:53:44.000Z","updated_at":"2024-04-18T02:36:54.132Z","dependencies_parsed_at":"2023-07-15T06:01:27.816Z","dependency_job_id":null,"html_url":"https://github.com/firejox/fjx-fiber","commit_stats":{"total_commits":51,"total_committers":1,"mean_commits":51.0,"dds":0.0,"last_synced_commit":"df982fbc4263572ffc6b39d9cdfe63ed384f5fa1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/firejox/fjx-fiber","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firejox%2Ffjx-fiber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firejox%2Ffjx-fiber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firejox%2Ffjx-fiber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firejox%2Ffjx-fiber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firejox","download_url":"https://codeload.github.com/firejox/fjx-fiber/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firejox%2Ffjx-fiber/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"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":["concurrency","coroutine-library","coroutines","csp","fiber","fibers","stackful-coroutines"],"created_at":"2026-01-16T09:40:12.193Z","updated_at":"2026-01-16T09:40:12.770Z","avatar_url":"https://github.com/firejox.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fjx-fiber [![Unit Test](https://github.com/firejox/fjx-fiber/actions/workflows/unit-test.yml/badge.svg)](https://github.com/firejox/fjx-fiber/actions/workflows/unit-test.yml)\n\nA thread safe stackful coroutine library in C. It would require thread library installed.\n\n## Features\n\n* stackful coroutines\n* multithread features\n\n## Platforms\n\nIt runs on Linux x86-64 platform. It may support other platforms in the futures.\n\n## Sample\n\nThis is a prime-seive example.\n\n```c\n#include \"fjx-fiber.h\"\n#include \u003cstdio.h\u003e\n#include \u003cstdlib.h\u003e\n\nstruct gen_data {\n    fjx_fiber_channel *ch;\n};\n\nstruct filter_data {\n    fjx_fiber_channel *ch;\n    fjx_fiber_channel *ch_next;\n    int prime;\n};\n\nvoid generate(void *data) {\n    struct gen_data *d = (struct gen_data*)data;\n\n    for (int i = 2; ; i++) {\n        fiber_channel_send(d-\u003ech, \u0026i);\n    }\n}\n\nvoid filter(void *data) {\n    struct filter_data *d = (struct filter_data*)data;\n    int i;\n    while (1) {\n        fiber_channel_receive(d-\u003ech, \u0026i);\n        if (i % d-\u003eprime) {\n            fiber_channel_send(d-\u003ech_next, \u0026i);\n        }\n    }\n}\n\nint main(void) {\n    fjx_fiber_channel *ch = NULL, *ch_next = NULL;\n\n    fiber_scheduler_init(2);\n    ch = fiber_channel_create(sizeof(int));\n    struct gen_data g = {.ch = ch};\n    struct filter_data f[103];\n\n    fiber_spawn(generate, \u0026g);\n\n    for (int i = 0; i \u003c 100; i++) {\n        int prime;\n        fiber_channel_receive(ch, \u0026prime);\n        printf(\"%d\\n\", prime);\n\n        ch_next = fiber_channel_create(sizeof(int));\n        f[i].ch = ch;\n        f[i].ch_next = ch_next;\n        f[i].prime = prime;\n\n        fiber_spawn(filter, \u0026f[i]);\n        ch = ch_next;\n    }\n\n    exit(EXIT_SUCCESS);\n}\n```\n\n## TODO\n\n* more platform support\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirejox%2Ffjx-fiber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirejox%2Ffjx-fiber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirejox%2Ffjx-fiber/lists"}