r/csharp • u/sebasjammer • 1d ago
Blog Svelto.Tasks 2.0: Efficient Multi-threaded Task Management for C#
I am back writing articles on my blog and I start with something LONG OVERDUE!
After years quietly powering several games I made, I’m finally presenting Svelto.Tasks 2.0.
Svelto.Tasks is an engine-agnostic, multithreaded and zero allocation task runner for C#, born from the need to have a game centric tasks framework with features that .NET tasks couldn't provide. Its premise is simple:
Tasks are iterator blocks. Runners are schedulers. Rather than handing execution timing and context to the runtime, a runner lets you decide:
- when a task advances,
- where it runs — main thread or a dedicated worker,
- how much work happens per tick,
- and when an entire task context must stop.
That last point matters a lot in games: for example, when a match ends, I want every task belonging to that match to stop with it—not rely on a CancellationToken having been passed and checked correctly through every layer.
Svelto.Tasks supports lightweight coroutines, composable tasks with return values and continuations, background runners, bounded parallel batches, pooling, profiling hooks, and optional Unity/Burst integrations.
It also interoperates with async/await, although the .NET Task bridge and Unity Burst job path are currently experimental and need real-world feedback.
It is not a replacement for Unity Jobs—but it provides a useful alternative for workloads where controlling execution, lifetime, pacing, and profiling is the priority.
The repository includes runnable .NET examples, tests, benchmarks
🔗 https://github.com/sebas77/Svelto.Tasks
also the repository
🔗https://github.com/sebas77/Svelto.Tasks.Examples
shows how it can be used to simplify massive parallelism synchronization. The example itself is actually quite interesting also because it uses the new compute buffer Unity api BeginWrite/EndWrite to upload compute buffers and graphic fences for cpu/gpu synchronization.
The article is at
🔗 https://www.sebaslab.com/svelto-tasks-2-0-efficient-multi-threaded-task-management-for-csharp/
Have fun! (and feedback is welcome, also on my discord server: https://discord.com/invite/uuTCYewjtc)
10
23h ago edited 23h ago
[removed] — view removed comment
1
1
u/FizixMan 13h ago
Thread removed: Gone a bit too far off the rails.
1
u/zenyl 13h ago
And the AI-generated post too, presumably?
1
u/FizixMan 13h ago
While there are some AI elements in the post text, it doesn't fully read like AI to me or the AI detectors, or like the multitude of zero effort AI written submissions that have been removed.
Obviously the readme/"blog" post have stronger AI elements, especially with how comprehensive it is. The library itself is older and pre-AI, but yes AI was used in the "2.0" update to it. But the code changes do not appear to be a one-shot "Claude, make rocket go now, make no mistakes" lazy zero-effort work.
At worst, it's maybe borderline encroaching on Rule 7, but /r/csharp has generally leaned towards leniency for borderline cases. Especially for users who have a long legitimate history of interactions and contributions on reddit. As opposed to some month-old account using LLM for all comments and spammed their "
ClaudeI made this!" repo with zero history.1
u/zenyl 13h ago
Even if we disregard the actual repo or "article", the post itself certainly seems to fall into the category AI-generated content. OP stated that this post was written using AI, and it checks several of the most generic AI tells: the unnatural use of bold, the obligatory em-dashes, a bullet-point list, escaped markdown syntax (in the bullet-point list), link emoji prepending links, and as you mention, it promotes a rewrote which (as OP has stated) was largely made using AI.
Seems to check many of the same boxes as so many other now-removed posts do.
And while it may seem petty to point out, the karma score of the post and my comments seem to imply that there's a general sentiment in the community against these types of AI-generated posts.
-6
23h ago edited 22h ago
[removed] — view removed comment
6
22h ago
[removed] — view removed comment
-1
22h ago
[removed] — view removed comment
3
11
u/fruediger 23h ago
Hi, I'm going to be honest with you: Your repo seems way to big and complex for me quickly skim through it and examine your code in detail. From what I saw, at least part of it looks like it is AI-generated. Also it seems to be structured in some special way, I believe that's Unity-specific, which is why I had a hard time trying to navigate it.
Please let me tell you a little anecdote which might be related to the claims you make about your project, one claim in particular:\ You see, a few weeks ago some posted a project of theirs here on r/csharp, claiming the achieved to implement an audio engine for C# with zero allocations when using it, or in their words, "entirely GC-free" (not a citation, but it's essentially what they said). Luckily, because of their rather easy-to-discover repository structure, it was rather quick to find many occasions where allocations still occurred in their code, and that's despite their claims. They got some pushback from the community in the comments.\ It turns out, just listening to your LLM of choice telling you what you want to hear, in their case that they achieved the almost impossible feat of creating a .NET user library with no allocations and no pressure on the GC, is not a good idea. You believe those claims and spread them further, because you don't understand the code anymore. At this point it's not your code any longer, it's not even your project anymore, it's the AI's project.
Why did I tell you this? Well, because of my inability to quickly understand your code and verify the claims you make about it, I need to ask you a question about the following part of your original post:
What exactly is a "zero allocation task runner"? Is the "task runner" without allocations? Does it run the task without causing any additional allocations? What does "zero allocation" mean in this context?
I'm sorry for doubting you, but past experiences show that AI-project authors often do not really understand what they are talking about and the implications of that.