W***o 发帖数: 6519 | 1 I am trying to write a user-level thread library in C. My strategy is to use
ucontext_t, signal, sigaction to support thread creation, initiation, join,
mutex, yield, cancel, and exit.
Without pre-emption, my code currently works with all the methods. But when
I try to add pre-emption support, the program seems running funny and
confusing. So I need to see some examples, better implemented in C.
I am new to C, and have only started C program from 20 days ago. I am
comfortable with using struct, pointer, pointer's pointer, context, signal,
signalpromask and sigaction, etc. The pre-emption requirements just throw me
way off... | d*******r 发帖数: 3299 | 2 github.com/noxrepo/nox-classic/blob/destiny/src/lib/threads/cooperative.cc
github.com/noxrepo/nox-classic/blob/destiny/src/lib/threads/impl.cc
几年前看过的 user space thread, C++ over C,
是 Stanford 的 OpenFlow Switch 的 controller | d*******r 发帖数: 3299 | 3 lz 你题目应该改成短小的: C/C++ examples for user-level threads
你看板上这么多 C/C++ 党居然都没人理你 ... 搞不好看你题目都不知道你想问啥 | W***o 发帖数: 6519 | 4 改了,谢谢
【在 d*******r 的大作中提到】 : lz 你题目应该改成短小的: C/C++ examples for user-level threads : 你看板上这么多 C/C++ 党居然都没人理你 ... 搞不好看你题目都不知道你想问啥
|
|