{"id":19115418,"url":"https://github.com/polytypic/idle-domains","last_synced_at":"2025-04-30T23:10:42.791Z","repository":{"id":65279108,"uuid":"588213860","full_name":"polytypic/idle-domains","owner":"polytypic","description":"Co-operative allocation of domains for OCaml","archived":false,"fork":false,"pushed_at":"2023-01-26T17:52:37.000Z","size":376,"stargazers_count":14,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-19T09:33:46.190Z","etag":null,"topics":["work-in-progress"],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/polytypic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-12T15:42:55.000Z","updated_at":"2024-11-04T23:33:44.000Z","dependencies_parsed_at":"2023-02-14T20:05:32.534Z","dependency_job_id":null,"html_url":"https://github.com/polytypic/idle-domains","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/polytypic%2Fidle-domains","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polytypic%2Fidle-domains/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polytypic%2Fidle-domains/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polytypic%2Fidle-domains/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polytypic","download_url":"https://codeload.github.com/polytypic/idle-domains/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251795415,"owners_count":21645023,"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":["work-in-progress"],"created_at":"2024-11-09T04:46:20.816Z","updated_at":"2025-04-30T23:10:42.741Z","avatar_url":"https://github.com/polytypic.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Co-operative allocation of domains for OCaml\n\nThis is a framework for co-operative allocation of domains for multicore OCaml.\n\nThe overall goal is to make it possible for asynchronous and parallel\nprogramming libraries to co-exist and co-operate profitably with minimal loss of\nperformance so that applications do not have to unnecessarily choose between\ncompeting library ecosystems.\n\nThe basic problem with domains in OCaml is that they are very expensive. They\nare relatively expensive to create and, more importantly, performance drops when\nthere are more domains than available hardware threads\n[even when domains are merely idle](https://github.com/ocaml-multicore/domainslib/issues/77#issuecomment-1290398870).\nEven if the cost of idle domains might be reduced via future runtime\noptimizations, having\n[at most one domain per available hardware thread](https://github.com/ocaml-multicore/domainslib/issues/92#issuecomment-1291671479)\ncan provide performance benefits.\n\nThis basically means that libraries that want to co-exist and co-operate should\nnever create domains on their own.\n\nOn the other hand, what (low-level) asynchronous and parallel programming\nlibraries want to do is to schedule operations on one or more domains. A\nscheduler typically runs a loop on one or more domains that takes operations\nfrom some sort of dispenser (queue, stack, work-stealing deque, ...). The exact\ndetails of how a scheduler is implemented tend to be very important.\n\nThe approach of `idle-domains` is to manage a number of domains and keep track\nof when a domain is idle. Co-operative libraries can then attempt to allocate\nidle domains for running their schedulers.\n\n**_`idle-domains` is not intended to be a general purpose scheduler_** and does\nnot make use of any unbounded dispensers for handling requests. `idle-domains`\nmerely manages the allocation of a finite number of domains. The goal is to\nprovide a layer on top of which effective and efficient schedulers can be\nwritten.\n\nSee\n[the reference manual](https://polytypic.github.io/idle-domains/idle-domains/Idle_domains/index.html)\nor the [Idle_domains.mli](src/main/Idle_domains.mli) signature for the API.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolytypic%2Fidle-domains","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolytypic%2Fidle-domains","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolytypic%2Fidle-domains/lists"}