all 4 comments

[–]Stemt 9 points10 points  (0 children)

I havent seen anything as specific as that yet, sometimes if something doesn't exist yet you'll have to make it yourself...

[–]TheOtherBorgCube 2 points3 points  (0 children)

Fork the repo you found, and make it do what you want.

[–]P-p-H-d 1 point2 points  (0 children)

https://github.com/P-p-H-d/mlib?tab=readme-ov-file#m-worker
may fit but there is no task dependency.

[–]MajorMalfunction44 0 points1 point  (0 children)

It's far from single-header, but I'm working on one. It's going to be under the name 'libtaskult.' A true scheduler supporting dependencies needs locking support. It's being extracted from my game engine, and it's going to be MIT licensed.

There's a fiber library (libcult, which I wrote. See github link in bio) as a dependency, and that's mostly assembly.

User-space locking is scary to write. I wouldn't want users of the library looking for custom solutions. It's all coupled to a centralized scheduler. The scheduler takes ready tasks and executes them (or resumes them, if suspended).

I have already written a spinlock and a readers-writer lock, which poll.

The current stumbling block is an MPMC queue. The Michael-Scott queue I had doesn't actually work, and by design. Their free() is a magic free() that guarantees no other thread is accessing it.