SaaSHub helps you find the best software and product alternatives Learn more →
Top 23 Go Concurrency Projects
-
JS concurrency is crap. It should be shot and buried in a lead coffin.
Debugging async code is pure hell. With Go, you have a normal debugger that can be used to step over the code. You can get normal stack traces for all threads if needed. There is a race detector that can catch most of unsynchronized object access.
With JS? You're on your fucking own. You can't find out the overall state of the system ("the list of all threads"), without getting deep into the guts of React or whatever framework you're using. Debugger is useless, as each `await` call drops you into the event loop. So pretty much every complicated non-trivial JS app ends up with _tons_ of race conditions, by depending on the order of async functions finishing.
Speaking of race conditions. Coming from classic multithreading and Go, I tried to use `Promise.race` to simulate the `select` statement. Turns out that in JS it is actually useless because it LEAKS MEMORY BY DESIGN: https://github.com/nodejs/node/issues/17469
Back to the article. It uses pre-generics Go. In more modern Go, you can use something like Conc to reduce the boilerplate: https://github.com/sourcegraph/conc?tab=readme-ov-file
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
-
-
golang-set
A simple, battle-tested and generic set type for the Go language. Trusted by Docker, 1Password, Ethereum and Hashicorp.
-
Hatchet is a distributed, fault-tolerant task queue which replaces traditional message brokers and pub/sub systems, built to solve problems like concurrency, fairness, and durability.
-
-
-
-
-
-
For worker pools of goroutines, this has always been "good enough" for me: https://github.com/gammazero/workerpool
-
go-wrk
go-wrk - a HTTP benchmarking tool based in spirit on the excellent wrk tool (https://github.com/wg/wrk)
-
-
-
Project mention: Kanzi is a modern, modular, expandable and efficient lossless data compressor | news.ycombinator.com | 2023-11-06
-
-
-
machine
Machine is a zero dependency library for highly concurrent Go applications. It is inspired by errgroup.Group with extra bells & whistles (by autom8ter)
-
-
-
-
sturdyc
A caching library with advanced concurrency features designed to make I/O heavy applications robust and highly performant
Project mention: Go caching library with advanced concurrency features | news.ycombinator.com | 2024-06-09 -
Project mention: Otter, Fastest Go in-memory cache based on S3-FIFO algorithm | news.ycombinator.com | 2023-12-23
In fact, lock-free queues have several problems at once, which prompted me to give up on them almost immediately.
1. Yes, S3-FIFO can be implemented using lock-free queues, but the problem is that each write to a filled cache using this design will cause a large number of additional atomic operations not friendly to the processor's cache, while bp-wrapper on the contrary amortizes this load. And reading with frequency update on hot entries can have a bad effect on performance. In many ways this is exactly what the last posts in my discussion with Ben are about (not really about this, but the current problem with otter read speed is caused by a similar problem). https://github.com/Yiling-J/theine-go/issues/29#issuecomment...
2. But the main problem for me is not even that. Lock-free queues work fine as long as you only need to support Get and Set operations, but as soon as you want to add features to your cache, the complexity of the implementation starts to increase, and some features are very hard to add to such a structure. Also, improving the eviction policy is under a big question mark, because not only do you have to think about how to improve the eviction policy, but also how to avoid locks while doing so or how not to slow down the implementation with your improvements. BP-Wrapper has no such problems at all, allows you to use any eviction policy and focus on improving different parts of your cache independently of each other.
Go Concurrency discussion
Go Concurrency related posts
-
The Case of a Leaky Goroutine
-
Yazi: Fast terminal file manager based on async I/O
-
RxGo: Reactive Extensions for the Go Language
-
Flowmatic: Structured concurrency made easy
-
Show HN: Rendering Fractals with Goroutines
-
I’ve learned Go‘s concurrency model by rendering fractals
-
GO: How to Write a Worker Pool
-
A note from our sponsor - SaaSHub
www.saashub.com | 5 Oct 2024
Index
What are some of the best open-source Concurrency projects in Go? This list will help you:
Project | Stars | |
---|---|---|
1 | conc | 8,949 |
2 | RxGo | 4,934 |
3 | concurrent-map | 4,271 |
4 | golang-set | 4,146 |
5 | hatchet | 4,086 |
6 | bild | 3,984 |
7 | go-concurrency-patterns | 2,729 |
8 | go-concurrency-guide | 2,417 |
9 | go-web-framework-benchmark | 2,066 |
10 | pond | 1,474 |
11 | workerpool | 1,311 |
12 | go-wrk | 911 |
13 | slacker | 808 |
14 | ZenQ | 656 |
15 | kanzi-go | 555 |
16 | gowp | 492 |
17 | goconcurrentqueue | 382 |
18 | machine | 360 |
19 | flowmatic | 362 |
20 | semgroup | 292 |
21 | util | 287 |
22 | sturdyc | 278 |
23 | theine-go | 254 |