News for hackers. Stuff that matters.
Re:Async Rust Is A Bad Language by colejohnson66 on Friday September 08, 2023 @01:03PM (#37436262)
Or desktop programs. Many GUI frameworks have a main thread that updates the layout (among other things) and various background ones.
Re:Async Rust Is A Bad Language by bluGill on Friday September 08, 2023 @01:58PM (#37437063)
Async and GUI threads are different concepts. Of course most GUIs have an event loop which can be used as a form of async, but with async you do your calculations in the main thread, while with GUIs you typically spin your calculations off to a different thread.

Most often when doing async you have a small number of tasks repeated many times, then you spin up one thread per CPU, and "randomly" assign each task as it comes in to a thread.

When doing GUI style programming you have a lot of different tasks and each task is done in exactly one thread.

Re:Async Rust Is A Bad Language by jayd16 on Friday September 08, 2023 @05:03PM (#37439389)
Hmm I would say the concepts are intertwined. Lots of GUI frameworks use async/await and the GUI thread is just another concurrency pattern that adds lock free thread exclusivity to async tasks that are pinned to a single thread.