kokejohh/pthipth ? reverse-engineered prompt

Reverse engineered prompt

Build me a small C thread library inspired by pthreads, but with non preemptive scheduling and priorities.

I want threads to run only when they voluntarily yield, with support for creating, joining, detaching, sleeping, and exiting threads. Please include priority handling, aging so low priority threads do not starve, and a simple thread pool for reusing workers. It should also have basic synchronization tools like mutexes, condition variables, and barriers, plus helper functions for getting and setting thread priority and a few runtime settings like stack size and aging values.

Make it feel usable from a normal C program, with a simple example app that shows creating a task and waiting for it to finish. If there are docs or build steps to clean up, please add them too, and look up current docs online if you need to.

Are you gonna build this?

make sure you review the code using arcumet

Try freeSponsored — opens Arcumet in a new tab