{"id":13420631,"url":"https://github.com/hnsl/librcd","last_synced_at":"2025-03-15T07:31:19.505Z","repository":{"id":19897802,"uuid":"23162804","full_name":"hnsl/librcd","owner":"hnsl","description":"A library for Rapid {C|Concurrency|Correct} Development","archived":false,"fork":false,"pushed_at":"2015-10-03T22:30:39.000Z","size":2914,"stargazers_count":34,"open_issues_count":14,"forks_count":4,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-11T00:02:31.539Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hnsl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-20T20:17:19.000Z","updated_at":"2023-10-18T20:03:33.000Z","dependencies_parsed_at":"2022-07-20T17:52:14.680Z","dependency_job_id":null,"html_url":"https://github.com/hnsl/librcd","commit_stats":null,"previous_names":["jumpstarter-io/librcd"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hnsl%2Flibrcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hnsl%2Flibrcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hnsl%2Flibrcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hnsl%2Flibrcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hnsl","download_url":"https://codeload.github.com/hnsl/librcd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243701029,"owners_count":20333614,"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-07-30T22:01:37.848Z","updated_at":"2025-03-15T07:31:18.925Z","avatar_url":"https://github.com/hnsl.png","language":"C","funding_links":[],"categories":["TODO scan for Android support in followings"],"sub_categories":[],"readme":"# librcd\n*A library for Rapid {C|Concurrency|Correct} Development*\n\nhttps://blog.jumpstarter.io/announcing-librcd-concurrency-segmented-stacks-c\n\nLibrcd is a new C standard library and POSIX replacement for x86_64 Linux, used for most things at [Jumpstarter](https://jumpstarter.io/). It comes with some custom syntax, and makes threading, strings, error handling, memory management and IO easy. Here's a small example:\n\n```c\n#include \"rcd.h\"\n#pragma librcd\n\njoin_locked(int) switcheroo(int next, join_server_params, int* current) {\n  int prev = *current;\n  DBG(\"swapping \", prev, \" \u003c-\u003e \", next);\n  *current = next;\n  return prev;\n}\n\nfiber_main worker(fiber_main_attr, int value, rcd_fid_t fid) {\n  for (;;) {\n    rio_wait(prng_rand() % RIO_NS_SEC);\n    value = switcheroo(value, fid);\n  }\n}\n\nvoid rcd_main(list(fstr_t)* main_args, list(fstr_t)* main_env) {\n  for (int i = 1; i \u003c= 5; i++) {\n    fmitosis {\n      spawn_fiber(worker(\"\", i, rcd_self));\n    }\n  }\n  int free_value = 0;\n  auto_accept_join(switcheroo, join_server_params, \u0026free_value);\n}\n```\n\nFor more code examples, covering e.g. strings, memory management and exceptions, see [the announce blog post](https://blog.jumpstarter.io/announcing-librcd-concurrency-segmented-stacks-c). You can also check out the source code of librcd (it's rather readable), or [wsr](https://github.com/jumpstarter-io/wsr), a basic web server library written on top of librcd.\n\nLibrcd is **highly non-portable**, and meant to be used mainly for server development, in a controlled environment. Only x86_64 Linux is supported, and this is [unlikely to change](https://github.com/jumpstarter-io/librcd/issues/2). Furthermore, due to license conflicts, binaries compiled with librcd [cannot currently be legally distributed](https://github.com/jumpstarter-io/librcd/issues/1).\n\nSome documentation [can be found in the wiki](https://github.com/jumpstarter-io/librcd/wiki); see in particular the [Installing](https://github.com/jumpstarter-io/librcd/wiki/Installing) page. The mentioned blog post also provides a lot of motivation and in-depth descriptions of most library features.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhnsl%2Flibrcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhnsl%2Flibrcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhnsl%2Flibrcd/lists"}