{"id":16660973,"url":"https://github.com/jberryman/unagi-chan","last_synced_at":"2026-01-30T14:20:04.699Z","repository":{"id":18483193,"uuid":"21678648","full_name":"jberryman/unagi-chan","owner":"jberryman","description":"A haskell library implementing fast and scalable concurrent queues for x86, with a Chan-like API","archived":false,"fork":false,"pushed_at":"2021-12-02T15:46:56.000Z","size":526,"stargazers_count":130,"open_issues_count":14,"forks_count":15,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-02T01:41:23.457Z","etag":null,"topics":["concurrency","haskell","queue"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jberryman.png","metadata":{"files":{"readme":"README.markdown","changelog":"CHANGELOG.markdown","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-10T04:03:16.000Z","updated_at":"2025-03-29T12:02:15.000Z","dependencies_parsed_at":"2022-07-09T16:30:59.383Z","dependency_job_id":null,"html_url":"https://github.com/jberryman/unagi-chan","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/jberryman/unagi-chan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jberryman%2Funagi-chan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jberryman%2Funagi-chan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jberryman%2Funagi-chan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jberryman%2Funagi-chan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jberryman","download_url":"https://codeload.github.com/jberryman/unagi-chan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jberryman%2Funagi-chan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28914049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"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","haskell","queue"],"created_at":"2024-10-12T10:32:45.611Z","updated_at":"2026-01-30T14:20:04.656Z","avatar_url":"https://github.com/jberryman.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/jberryman/unagi-chan.svg?branch=master)](https://travis-ci.com/jberryman/unagi-chan)\n\nThe library is [available on hackage](http://hackage.haskell.org/package/unagi-chan)\nand you can install it with:\n\n    $ cabal install unagi-chan\n\n## Design\n\nThe idea is to design a queue around the x86 fetch-and-add instruction, which\nperforms well under contention.\n\nThe queue is conceptually simple, consisting of: an infinite array, and two\natomic counters, one for readers and another for writers. A read or write\noperation consists of incrementing the appropriate counter and racing to\nperform an atomic operation on the specified index. \n\nIf the writer wins it has written its value for the reader to find and exits.\nWhen it loses it does a rendezvous with the blocked or blocking reader, via\nanother mechanism and hands off its value.\n\n## Linearizabillity\n\nThe queue has FIFO semantics, reasoning in terms of linearizability. Our atomic\ncounter ensures that all non-overlapping reads and writes are assigned indices\nin temporal order.\n\n## Lockfree - ness\n\nOperations are non-blocking, with the exception that a stalled writer may block\nat most one reader (the reader \"assigned\" to it by our internal counter).\n\n## Performance\n\nHere is an example benchmark measuring the time taken to concurrently write and\nread 100,000 messages, with work divided amongst increasing number of readers\nand writers, comparing against the top-performing queues in the standard\nlibraries. The inset graph shows a zoomed-in view on the implementations here.\n\n![Benchmarks](http://i.imgur.com/J5rLUFn.png)\n\nSome of these variants may be deprecated in the future if they are found to\nprovide little performance benefit, or no unique features; you should benchmark\nand experiment with them for your use cases, and please submit pull requests\nfor additions to the benchmark suite that reflect what you find.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjberryman%2Funagi-chan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjberryman%2Funagi-chan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjberryman%2Funagi-chan/lists"}