{"id":16099008,"url":"https://github.com/hellerve/gt","last_synced_at":"2025-07-17T00:31:36.633Z","repository":{"id":79626264,"uuid":"168131684","full_name":"hellerve/gt","owner":"hellerve","description":"A simple greenthreading library","archived":false,"fork":false,"pushed_at":"2020-08-28T22:43:17.000Z","size":7,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T13:21:36.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hellerve.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-01-29T09:56:31.000Z","updated_at":"2023-09-08T17:49:49.000Z","dependencies_parsed_at":"2023-05-13T21:31:24.290Z","dependency_job_id":null,"html_url":"https://github.com/hellerve/gt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hellerve/gt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellerve%2Fgt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellerve%2Fgt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellerve%2Fgt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellerve%2Fgt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hellerve","download_url":"https://codeload.github.com/hellerve/gt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellerve%2Fgt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265554774,"owners_count":23787279,"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":[],"created_at":"2024-10-09T18:25:24.659Z","updated_at":"2025-07-17T00:31:36.612Z","avatar_url":"https://github.com/hellerve.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gt\n\nA simple greenthreads implementation for massive lightweight threads. It’s\nadapted from [this tutorial](https://c9x.me/articles/gthreads/intro.html), with\nthe—kind of important—additions that the list of scheduled threads grows\ndynamically instead of failing to schedule if the maximum thread number is\nreached, and that you can pass one argument to the functions (through the use\nof structs you can add as many arguments as you like).\n\nI’d like to use this as a testbed to play around with schedulers if I find the\ntime.\n\n## Example\n\n```c\n#include \u003cstdio.h\u003e\n\n#include \"gt.h\"\n\nvoid f(void* unused) {\n  static int x;\n  int i, id;\n\n  id = ++x; // thread ID\n  for (i = 0; i \u003c 10; i++) {\n    printf(\"%d %d\\n\", id, i);\n    gt_yield();\n  }\n}\n\nint main() {\n  int i;\n  gt_init();\n\n  // no argument; pass an argument instead of NULL here\n  for (i = 0; i \u003c 270; i++) gt_go(f, NULL);\n\n  // the second argument is an optional cleanup function\n  gt_ret(1, NULL);\n}\n```\n\n\u003chr/\u003e\n\nHave fun!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellerve%2Fgt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhellerve%2Fgt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellerve%2Fgt/lists"}