mastodon.world is one of the many independent Mastodon servers you can use to participate in the fediverse.
Generic Mastodon server for anyone to use.

Server stats:

9.1K
active users

#async

1 post1 participant0 posts today
Felix Palmen :freebsd: :c64:<p>Now that <a href="https://mastodon.bsd.cafe/tags/swad" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>swad</span></a> 0.7 is released, it's time to prepare a new release of <a href="https://mastodon.bsd.cafe/tags/poser" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>poser</span></a>, my own lib supporting <a href="https://mastodon.bsd.cafe/tags/services" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>services</span></a> on <a href="https://mastodon.bsd.cafe/tags/POSIX" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>POSIX</span></a> systems, following a <a href="https://mastodon.bsd.cafe/tags/reactor" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>reactor</span></a> with <a href="https://mastodon.bsd.cafe/tags/threadpool" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>threadpool</span></a> design.</p><p>During development of swad, I moved poser from using strictly only POSIX APIs (with the scalability limits of e.g. <a href="https://mastodon.bsd.cafe/tags/select" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>select</span></a>) to auto-detected support for <a href="https://mastodon.bsd.cafe/tags/kqueue" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>kqueue</span></a>, <a href="https://mastodon.bsd.cafe/tags/epoll" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>epoll</span></a>, <a href="https://mastodon.bsd.cafe/tags/eventports" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>eventports</span></a>, <a href="https://mastodon.bsd.cafe/tags/signalfd" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>signalfd</span></a> and <a href="https://mastodon.bsd.cafe/tags/timerfd" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>timerfd</span></a> (so now it could, in theory(!), "compete" with e.g. libevent). I also fixed quite some hidden bugs, and added more base functionality, like a <a href="https://mastodon.bsd.cafe/tags/dictionary" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>dictionary</span></a> using nested hashtables internally, or <a href="https://mastodon.bsd.cafe/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a> tasks mimicking the async/await pattern known from e.g, <a href="https://mastodon.bsd.cafe/tags/csharp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>csharp</span></a>. I also deprecated two features, the periodic and global "service tick" (superseded by individual timers) and the "resolve hosts" property of a "connection" (superseded by a separate resolve class).</p><p>I'll have to decide on a few things, e.g. whether I'll remove the deprecated stuff immediately and bump the major version of the "posercore" lib. I guess I'll do just that. I'd also like to add all the web-specific stuff (http 1.0/1.1 server) that's currently part of the swad code as a "poserweb" lib. This would get a major version of 0, indicating a generally unstable API/ABI as of now....</p><p>And then, I'd have to decide where certain utility classes belong to. The rate limiter is probably useful for things other than web, so it should probably go to core. What about url encoding/decoding, for example? 🤔</p><p>Stay tuned, something will come here, maybe helping you to write a nice service in plain <a href="https://mastodon.bsd.cafe/tags/C" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>C</span></a> 😎:</p><p><a href="https://github.com/Zirias/poser" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/Zirias/poser</span><span class="invisible"></span></a></p>
Hacker News<p>How async/await works in Python</p><p><a href="https://tenthousandmeters.com/blog/python-behind-the-scenes-12-how-asyncawait-works-in-python/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">tenthousandmeters.com/blog/pyt</span><span class="invisible">hon-behind-the-scenes-12-how-asyncawait-works-in-python/</span></a></p><p><a href="https://mastodon.social/tags/HackerNews" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>HackerNews</span></a> <a href="https://mastodon.social/tags/asyncawait" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>asyncawait</span></a> <a href="https://mastodon.social/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a> <a href="https://mastodon.social/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> <a href="https://mastodon.social/tags/concurrency" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>concurrency</span></a> <a href="https://mastodon.social/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a> <a href="https://mastodon.social/tags/Python3" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python3</span></a></p>
Gea-Suan Lin<p><a href="https://blog.gslin.org/archives/2025/05/08/12389/postgresql-18-%e7%9a%84-async-i-o/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">blog.gslin.org/archives/2025/0</span><span class="invisible">5/08/12389/postgresql-18-%e7%9a%84-async-i-o/</span></a></p><p>PostgreSQL 18 的 async i/o</p><p><a href="https://abpe.org/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a> <a href="https://abpe.org/tags/database" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>database</span></a> <a href="https://abpe.org/tags/i" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>i</span></a>/o <a href="https://abpe.org/tags/input" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>input</span></a> <a href="https://abpe.org/tags/io" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>io</span></a> <a href="https://abpe.org/tags/io_uring" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>io_uring</span></a> <a href="https://abpe.org/tags/linux" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>linux</span></a> <a href="https://abpe.org/tags/oltp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>oltp</span></a> <a href="https://abpe.org/tags/output" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>output</span></a> <a href="https://abpe.org/tags/performance" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>performance</span></a> <a href="https://abpe.org/tags/pg" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>pg</span></a> <a href="https://abpe.org/tags/pgsql" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>pgsql</span></a> <a href="https://abpe.org/tags/postgresql" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>postgresql</span></a> <a href="https://abpe.org/tags/rdbms" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>rdbms</span></a> <a href="https://abpe.org/tags/read" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>read</span></a> <a href="https://abpe.org/tags/speed" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>speed</span></a> <a href="https://abpe.org/tags/stream" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>stream</span></a></p>
Jan :rust: :ferris:<p>Bach - by camshaft</p><p><a href="https://github.com/camshaft/bach" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/camshaft/bach</span><span class="invisible"></span></a></p><p>from their README:</p><p>"Bach is a <a href="https://floss.social/tags/Rust" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Rust</span></a>-based framework for simulating and testing complex async/await-based systems in a non-real-time environment. It's capable of modeling network protocols, queueing systems, and concurrent task interactions with testing and visualization tools."</p><p>Wow, this crate looks awesome and very underrated (by the number of Github stars).</p><p><a href="https://floss.social/tags/RustLang" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>RustLang</span></a> <a href="https://floss.social/tags/CrateTip" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CrateTip</span></a> <a href="https://floss.social/tags/Async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Async</span></a> <a href="https://floss.social/tags/Fuzzing" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Fuzzing</span></a> <a href="https://floss.social/tags/SimulationTesting" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>SimulationTesting</span></a> <a href="https://floss.social/tags/Network" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Network</span></a> <a href="https://floss.social/tags/Concurrency" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Concurrency</span></a></p>
Hacker News<p>Feather: Feather: A web framework that skips Rust's async boilerplate and jus</p><p><a href="https://github.com/BersisSe/feather" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/BersisSe/feather</span><span class="invisible"></span></a></p><p><a href="https://mastodon.social/tags/HackerNews" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>HackerNews</span></a> <a href="https://mastodon.social/tags/Feather" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Feather</span></a> <a href="https://mastodon.social/tags/Rust" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Rust</span></a> <a href="https://mastodon.social/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a> <a href="https://mastodon.social/tags/web" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>web</span></a> <a href="https://mastodon.social/tags/framework" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>framework</span></a> <a href="https://mastodon.social/tags/boilerplate" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>boilerplate</span></a> <a href="https://mastodon.social/tags/developer" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>developer</span></a> <a href="https://mastodon.social/tags/tools" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>tools</span></a></p>
Dan Fairs<p>Python asynchronous programming with async/await is a poisonous API that you inflict on your caller whether they like it or not. You plunge them into a world of pain when they want to, I dunno, use a debugger or something.</p><p>It's made worse by the fact this whole thing is a bolt-on to the language, and you inevitably have to wade through an ocean of bullshit bridging between the sync and async worlds.</p><p>Go has this much better - everyone writes synchronous code, and the _caller_ decides whether they need async.</p><p>Thank you for coming to my etc etc</p><p><a href="https://metalhead.club/tags/python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>python</span></a> <a href="https://metalhead.club/tags/golang" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>golang</span></a> <a href="https://metalhead.club/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a> <a href="https://metalhead.club/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a></p>
Felix Palmen :freebsd: :c64:<p>Regarding my <a href="https://mastodon.bsd.cafe/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a> / <a href="https://mastodon.bsd.cafe/tags/await" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>await</span></a> "imitation" for <a href="https://mastodon.bsd.cafe/tags/C" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>C</span></a>, I already mentioned it requires the (unfortunately deprecated) <a href="https://mastodon.bsd.cafe/tags/POSIX" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>POSIX</span></a> user context switching (<a href="https://mastodon.bsd.cafe/tags/getcontext" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>getcontext</span></a>, <a href="https://mastodon.bsd.cafe/tags/swapcontext" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>swapcontext</span></a>, ...). I check availability in the build. The fallback is an implementation that blocks a worker <a href="https://mastodon.bsd.cafe/tags/thread" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>thread</span></a> while awaiting an async task.</p><p>Now, one of the systems that doesn't provide the required user context switching is unfortunately <a href="https://mastodon.bsd.cafe/tags/OpenBSD" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>OpenBSD</span></a>. Does anyone know of a suitable workaround? The requirement is pretty clear: Ability to "put aside" the context of a thread (registers, PC, dedicated <a href="https://mastodon.bsd.cafe/tags/stack" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>stack</span></a>, ...) to resume execution later. Implementations following POSIX also save/restore the signal mask, which is a feature I would *not* need.</p><p>Any ideas?</p>
Habr<p>Укрощаем асинхронный код с помощью async/await</p><p>Привет! Меня зовут Андрей Максимкин, я iOS-разработчик в hh. Мы в команде активно используем async/await подход при написании нового кода, а также активно применяем при переписывании старого. В процессе работы сталкивались с некоторыми интересными и не самыми очевидными моментами — их и рассмотрим в статье. Работа с различными потоками — очень важная часть разработки мобильных приложений под iOS. Грамотное распределение нагрузки положительно влияет на скорость работы приложения, а значит, и на пользовательский опыт. До Swift 5.5 для работы с многопоточностью в основном использовали фреймворки GCD и NSOperation. Начиная с версии Swift 5.5 стал доступен функционал async/await. В статье мы кратко расскажем о базовых принципах данного подхода и сделаем акцент на проблемах и особенностях, которые необходимо знать при написании кода. Информация будет полезна тем, кто уже знаком с функционалом async/await, а некоторые примеры могут быть интересны и более продвинутым разработчикам. Поехали!</p><p><a href="https://habr.com/ru/companies/hh/articles/904506/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">habr.com/ru/companies/hh/artic</span><span class="invisible">les/904506/</span></a></p><p><a href="https://zhub.link/tags/ios" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ios</span></a> <a href="https://zhub.link/tags/%D0%BC%D0%BE%D0%B1%D0%B8%D0%BB%D1%8C%D0%BD%D0%B0%D1%8F_%D1%80%D0%B0%D0%B7%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%BA%D0%B0" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>мобильная_разработка</span></a> <a href="https://zhub.link/tags/%D0%BC%D0%BE%D0%B1%D0%B8%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5_%D0%BF%D1%80%D0%B8%D0%BB%D0%BE%D0%B6%D0%B5%D0%BD%D0%B8%D1%8F" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>мобильные_приложения</span></a> <a href="https://zhub.link/tags/ios_%D1%80%D0%B0%D0%B7%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%BA%D0%B0" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ios_разработка</span></a> <a href="https://zhub.link/tags/ios_development" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ios_development</span></a> <a href="https://zhub.link/tags/swift" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>swift</span></a> <a href="https://zhub.link/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a> <a href="https://zhub.link/tags/await" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>await</span></a> <a href="https://zhub.link/tags/%D0%B0%D1%81%D0%B8%D0%BD%D1%85%D1%80%D0%BE%D0%BD%D0%BD%D0%BE%D0%B5_%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%BC%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>асинхронное_программирование</span></a> <a href="https://zhub.link/tags/%D0%B0%D1%81%D0%B8%D0%BD%D1%85%D1%80%D0%BE%D0%BD%D0%BD%D1%8B%D0%B5_%D0%B7%D0%B0%D0%B4%D0%B0%D1%87%D0%B8" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>асинхронные_задачи</span></a></p>
Ian Badcoe<p><a href="https://peoplemaking.games/tags/GameDev" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>GameDev</span></a> <a href="https://peoplemaking.games/tags/Godot" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Godot</span></a> <a href="https://peoplemaking.games/tags/CSharp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CSharp</span></a> <a href="https://peoplemaking.games/tags/Async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Async</span></a> <a href="https://peoplemaking.games/tags/Promise" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Promise</span></a> </p><p>I used to know how C# Tasks worked, I swear, but I spent half of yesterday trying to chain three simple tasks together with no luck.</p><p>So I Nugetted a Promise library instead and had it working in 10 minutes...</p>
Felix Palmen :freebsd: :c64:<p>digging a bit deeper to further improve this <a href="https://mastodon.bsd.cafe/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a> / <a href="https://mastodon.bsd.cafe/tags/await" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>await</span></a> implementation:</p><p>Keeping all the <a href="https://mastodon.bsd.cafe/tags/stacks" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>stacks</span></a> mapped certainly makes sense to avoid excessive <a href="https://mastodon.bsd.cafe/tags/mmap" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>mmap</span></a> overhead ... but on *some* (most?) systems (I checked <a href="https://mastodon.bsd.cafe/tags/FreeBSD" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>FreeBSD</span></a> and <a href="https://mastodon.bsd.cafe/tags/Linux" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Linux</span></a> docs for now), we can let the kernel know when the mapping just contains worthless scratch (which will be the case after a thread job finishes until another thread job claims the same stack). Then, if there's a need to free pages, the kernel can avoid pointlessly writing that garbage to <a href="https://mastodon.bsd.cafe/tags/swap" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>swap</span></a>. 😎 </p><p><a href="https://github.com/Zirias/poser/commit/9867c5f3845b3b998ca758f3b6e8047c2f813319" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/Zirias/poser/commit</span><span class="invisible">/9867c5f3845b3b998ca758f3b6e8047c2f813319</span></a></p><p><a href="https://mastodon.bsd.cafe/tags/C" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>C</span></a> <a href="https://mastodon.bsd.cafe/tags/coding" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>coding</span></a></p>
James Edward Gray II<p>This article is a great read about how to do asynchronous Elixir testing right: <a href="https://andrealeopardi.com/posts/async-tests-in-elixir/" rel="nofollow noopener noreferrer" target="_blank">https://andrealeopardi.com/posts/async-tests-in-elixir/</a></p><p><a class="hashtag" href="https://genserver.social/tag/elixir" rel="nofollow noopener noreferrer" target="_blank">#elixir</a> <a class="hashtag" href="https://genserver.social/tag/async" rel="nofollow noopener noreferrer" target="_blank">#async</a> <a class="hashtag" href="https://genserver.social/tag/testing" rel="nofollow noopener noreferrer" target="_blank">#testing</a></p>
Felix Palmen :freebsd: :c64:<p>Revisiting <a href="https://mastodon.bsd.cafe/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a> / <a href="https://mastodon.bsd.cafe/tags/await" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>await</span></a> in <a href="https://mastodon.bsd.cafe/tags/POSIX" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>POSIX</span></a> C, trying to "add some <a href="https://mastodon.bsd.cafe/tags/security" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>security</span></a>" 🙈 </p><p>Recap: Consider a classic <a href="https://mastodon.bsd.cafe/tags/reactor" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>reactor</span></a>-style service in C with a <a href="https://mastodon.bsd.cafe/tags/threadpool" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>threadpool</span></a> attached to run the individual request handlers. When such a handler needs to do some I/O, it'll have to wait for its completion, and doing so is kind of straight forward by just blocking the worker thread executing the job until whatever I/O was needed completes.</p><p>Now, blocking a thread is never a great thing to do and I recently tooted about an interesting alternative I found: Make use of the (unfortunately deprecated) POSIX user context switching to enable releasing the worker thread while waiting. In a nutshell, you create a context with <a href="https://mastodon.bsd.cafe/tags/makecontext" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>makecontext</span></a> that has its own private <a href="https://mastodon.bsd.cafe/tags/stack" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>stack</span></a>, and then you can use <a href="https://mastodon.bsd.cafe/tags/swapcontext" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>swapcontext</span></a> to get off the thread, and later again to get back on the thread. A minor issue is: It must be the *same* thread ... so you might have to wait until it completes something else before you can resume your job. But then, that's probably okayish, you can make sure in your job scheduling to only use worker threads with awaited tasks attached when no other thread is available.</p><p>In my first implementation, I just used <a href="https://mastodon.bsd.cafe/tags/malloc" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>malloc</span></a> to create a 64kiB private stack for each thread job. That's perfectly fine if you can guarantee your job will never consume more stack space, AND it won't have any vulnerabilities allowing some attacker to mess with the stack. But in practice, especially for a library offering this async/await implementation, it's nothing but a wild <a href="https://mastodon.bsd.cafe/tags/CVE" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CVE</span></a> generator.</p><p>So, I now improved on that:</p><p>* Allocate a much larger stack of now 2MiB. That alone makes issues at least less likely. And on a sane modern OS, we can still assume pages will only be mapped "on demand".<br>* Only allocate the stack directly before running the thread job, and delegate allocation to some internal "stack manager" that keeps track of all allocated stacks and reuses them, only freeing them on exit. This should avoid most of the allocation overhead.<br>* If MAP_ANON / MAP_ANONYMOUS is available, use <a href="https://mastodon.bsd.cafe/tags/mmap" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>mmap</span></a> for allocating the stack. That at least gives a chance to stay away from other allocations ....<br>* But finally, if MAP_STACK is available, use this flag! From my research, <a href="https://mastodon.bsd.cafe/tags/FreeBSD" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>FreeBSD</span></a>, <a href="https://mastodon.bsd.cafe/tags/OpenBSD" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>OpenBSD</span></a> and <a href="https://mastodon.bsd.cafe/tags/NetBSD" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>NetBSD</span></a> will for example make sure there's at least one "guard page" below a stack mapped with this flag, so a stack overflow consistently takes the SIGSEGV emergency exit 😆. <a href="https://mastodon.bsd.cafe/tags/Linux" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Linux</span></a> knows this flag as well, but doesn't seem to implement such protection at this time ... 🤔 </p><p><a href="https://mastodon.bsd.cafe/tags/C" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>C</span></a> <a href="https://mastodon.bsd.cafe/tags/coding" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>coding</span></a></p>
Andrija Petrovic<p>A gem of its own<br><a href="https://natkr.com/2025-04-10-async-from-scratch-1/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">natkr.com/2025-04-10-async-fro</span><span class="invisible">m-scratch-1/</span></a><br><a href="https://floss.social/tags/rust" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>rust</span></a> <a href="https://floss.social/tags/rustlang" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>rustlang</span></a> <a href="https://floss.social/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a></p>
Surya Teja K<p>easy not, Async Rust is!</p><p><a href="https://social.linux.pizza/tags/rustlang" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>rustlang</span></a> <a href="https://social.linux.pizza/tags/meme" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>meme</span></a> <a href="https://social.linux.pizza/tags/rust" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>rust</span></a> <a href="https://social.linux.pizza/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a></p>
Tim<p>Really great visualization of async timing in Rust with Tokio.</p><p><a href="https://github.com/alexpusch/rust-magic-patterns/blob/master/visual-journey-through-async-rust/Readme.md?__readwiseLocation=" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/alexpusch/rust-magi</span><span class="invisible">c-patterns/blob/master/visual-journey-through-async-rust/Readme.md?__readwiseLocation=</span></a></p><p><a href="https://mastodon.social/tags/dataviz" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>dataviz</span></a> <a href="https://mastodon.social/tags/rustlang" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>rustlang</span></a> <a href="https://mastodon.social/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a> <a href="https://mastodon.social/tags/tokio" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>tokio</span></a></p>
Pyrzout :vm:<p>DOGE Worker’s Code Supports NLRB Whistleblower <a href="https://krebsonsecurity.com/2025/04/doge-workers-code-supports-nlrb-whistleblower/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">krebsonsecurity.com/2025/04/do</span><span class="invisible">ge-workers-code-supports-nlrb-whistleblower/</span></a> <a href="https://social.skynetcloud.site/tags/DepartmentofHealthandHumanServices" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>DepartmentofHealthandHumanServices</span></a> <a href="https://social.skynetcloud.site/tags/DepartmentofGovernmentEfficiency" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>DepartmentofGovernmentEfficiency</span></a> <a href="https://social.skynetcloud.site/tags/NationalLaborRelationsBoard" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>NationalLaborRelationsBoard</span></a> <a href="https://social.skynetcloud.site/tags/TheWallStreetJournal" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>TheWallStreetJournal</span></a> <a href="https://social.skynetcloud.site/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a>-ip-rotator <a href="https://social.skynetcloud.site/tags/ALittleSunshine" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ALittleSunshine</span></a> <a href="https://social.skynetcloud.site/tags/DanielJ" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>DanielJ</span></a>.Berulis <a href="https://social.skynetcloud.site/tags/LaborDepartment" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>LaborDepartment</span></a> <a href="https://social.skynetcloud.site/tags/TheComingStorm" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>TheComingStorm</span></a> <a href="https://social.skynetcloud.site/tags/Browserless" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Browserless</span></a> <a href="https://social.skynetcloud.site/tags/MarkoElez" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>MarkoElez</span></a> <a href="https://social.skynetcloud.site/tags/Integuru" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Integuru</span></a> <a href="https://social.skynetcloud.site/tags/Politico" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Politico</span></a> <a href="https://social.skynetcloud.site/tags/Ge0rg3" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Ge0rg3</span></a> <a href="https://social.skynetcloud.site/tags/GitHub" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>GitHub</span></a> <a href="https://social.skynetcloud.site/tags/DOGE" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>DOGE</span></a></p>
KrebsOnSecurity RSS<p>DOGE Worker’s Code Supports NLRB Whistleblower</p><p><a href="https://krebsonsecurity.com/2025/04/doge-workers-code-supports-nlrb-whistleblower/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">krebsonsecurity.com/2025/04/do</span><span class="invisible">ge-workers-code-supports-nlrb-whistleblower/</span></a></p><p> <a href="https://burn.capital/tags/DepartmentofHealthandHumanServices" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>DepartmentofHealthandHumanServices</span></a> <a href="https://burn.capital/tags/DepartmentofGovernmentEfficiency" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>DepartmentofGovernmentEfficiency</span></a> <a href="https://burn.capital/tags/NationalLaborRelationsBoard" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>NationalLaborRelationsBoard</span></a> <a href="https://burn.capital/tags/TheWallStreetJournal" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>TheWallStreetJournal</span></a> <a href="https://burn.capital/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a>-ip-rotator <a href="https://burn.capital/tags/ALittleSunshine" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ALittleSunshine</span></a> <a href="https://burn.capital/tags/DanielJ" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>DanielJ</span></a>.Berulis <a href="https://burn.capital/tags/LaborDepartment" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>LaborDepartment</span></a> <a href="https://burn.capital/tags/TheComingStorm" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>TheComingStorm</span></a> <a href="https://burn.capital/tags/Browserless" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Browserless</span></a> <a href="https://burn.capital/tags/MarkoElez" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>MarkoElez</span></a> <a href="https://burn.capital/tags/Integuru" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Integuru</span></a> <a href="https://burn.capital/tags/Politico" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Politico</span></a> <a href="https://burn.capital/tags/Ge0rg3" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Ge0rg3</span></a> <a href="https://burn.capital/tags/GitHub" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>GitHub</span></a> <a href="https://burn.capital/tags/DOGE" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>DOGE</span></a></p>
Kevin P. Fleming<p>A couple of weeks ago I asked the Fediverse for recommendations about doing async I/O in a Python application which *also* had a REPL-like interface. I got quite a few useful responses, which ended up leading me to Python Prompt Toolkit.</p><p>Here is the result: a single-file script with embedded dependencies (thanks to PEP 723 and uv) which opens a serial port, asynchronously writes data to it and reads data from it, all while displaying a prompt and accepting input from the user.</p><p><a href="https://forge.km6g.us/kpfleming/muart-failsafe/src/commit/9179da2f6acc30dbead5e54a2de2184b6fe1c7f8/prototest/prototest.py" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">forge.km6g.us/kpfleming/muart-</span><span class="invisible">failsafe/src/commit/9179da2f6acc30dbead5e54a2de2184b6fe1c7f8/prototest/prototest.py</span></a></p><p>None of the program's actual functionality is present yet, but having the scaffolding in place makes me happy.</p><p><a href="https://mastodon.km6g.us/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a> <a href="https://mastodon.km6g.us/tags/Async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Async</span></a> <a href="https://mastodon.km6g.us/tags/REPL" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>REPL</span></a></p>
jexner<p>So, question for the <a href="https://tooting.ch/tags/Android" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Android</span></a> <a href="https://tooting.ch/tags/Kotlin" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Kotlin</span></a> crowd: I have a process that is async (upload of a file), and that needs to be run a bunch of times. If I start each upload in a loop, I cannot really cancel or observe, bcs it is retrofit/okhttp who is managing the async stuff and the loop ends fast.<br>It is entirely possible that every now and again, I have to upload a lot of those files, and not being able to cancel is not acceptable.<br>So, what are my options?<br><a href="https://tooting.ch/tags/BuildInPublic" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>BuildInPublic</span></a> <a href="https://tooting.ch/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a> <a href="https://tooting.ch/tags/FollowerPower" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>FollowerPower</span></a></p>
Felix Palmen :freebsd: :c64:<p>Today, I implemented the <a href="https://mastodon.bsd.cafe/tags/async" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>async</span></a> / <a href="https://mastodon.bsd.cafe/tags/await" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>await</span></a> pattern (as known from <a href="https://mastodon.bsd.cafe/tags/csharp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>csharp</span></a> and meanwhile quite some other languages) ...</p><p>... in good old <a href="https://mastodon.bsd.cafe/tags/C" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>C</span></a>! 😎 </p><p>Well, at least sort of.</p><p>* It requires some standard library support, namely <a href="https://mastodon.bsd.cafe/tags/POSIX" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>POSIX</span></a> user context switching with <a href="https://mastodon.bsd.cafe/tags/getcontext" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>getcontext</span></a> and friends, which was deprecated in POSIX-1.2008. But it's still available on many systems, including <a href="https://mastodon.bsd.cafe/tags/FreeBSD" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>FreeBSD</span></a>, <a href="https://mastodon.bsd.cafe/tags/NetBSD" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>NetBSD</span></a>, <a href="https://mastodon.bsd.cafe/tags/Linux" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Linux</span></a> (with <a href="https://mastodon.bsd.cafe/tags/glibc" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>glibc</span></a>). It's NOT available e.g. on <a href="https://mastodon.bsd.cafe/tags/OpenBSD" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>OpenBSD</span></a>, or Linux with some alternative libc.</p><p>* I can't do anything about the basic language syntax, so some boilerplate comes with using it.</p><p>* It has some overhead (room for extra stacks, even extra syscalls as getcontext unfortunately also always saves/restores the signal mask)</p><p>But then ... async/await in C! 🥳 </p><p>Here are the docs:<br><a href="https://zirias.github.io/poser/api/latest/class_p_s_c___async_task.html" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">zirias.github.io/poser/api/lat</span><span class="invisible">est/class_p_s_c___async_task.html</span></a></p><p><a href="https://mastodon.bsd.cafe/tags/C" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>C</span></a> <a href="https://mastodon.bsd.cafe/tags/coding" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>coding</span></a></p>