mastodontech.de ist einer von vielen unabhängigen Mastodon-Servern, mit dem du dich im Fediverse beteiligen kannst.
Offen für alle (über 16) und bereitgestellt von Markus'Blog

Serverstatistik:

1,5 Tsd.
aktive Profile

#concurrency

2 Beiträge2 Beteiligte0 Beiträge heute

Concurrency Concept: Say you have two threads trying to access the same bytes.
Instead of a lock, both threads can reserve a specific time interval, in which they are allowed to access the memory area. So the access timeline would look something like this (t1 and t2 being the timeframe's the respective threads can access it): t1 | t2 | t1 | t2 | ...

One day I need to learn wtf this @ sendable stuff is that Xcode whines about nowadays. It seems to be something that should be simple that has gone through a concurrent swiftification and instantly become hard to understand and impossible to implement correctly. Everything about concurrency in Swift feels unnecessarily complicated and cursed. Or maybe I’m just too dumb for for this? Very plausible.

Antwortete im Thread

@drmorr I really feel these guys should give papaya a try: github.com/ibraheemdev/papaya

It is exactly designed for use cases such as these, where you have incredibly high read contention, and you don’t want to have deadlocks at all.

It’s a relatively young library, so I can understand they may want to do very careful testing, but an API that cannot deadlock is absolutely worth it IMO.

GitHubGitHub - ibraheemdev/papaya: A fast and ergonomic concurrent hashmap for read-heavy workloads.A fast and ergonomic concurrent hashmap for read-heavy workloads. - ibraheemdev/papaya