由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - Any examples for implementing user-level threads library in C?
相关主题
pthread_create inside a constructor怎么练习C++ multi-threading?
C++ Q05: pointer to constant variableC++ InitializeCriticalSection问题
Go adopts JavaScript’s idea of semicolon insertiondifference between: char** p and char*p[] ??
面试问题一问 (转载)VC++ release VS debug
how many ways in C++ to release a mutex?thread c++ 问题
C++的一个mutex问题一个multithread的问题(是不是有人觉的很简单?)
VC++线程问题Is the order of initialization a, b, c or c, b, a?
请教大家一道C的面试题mutex和semaphore的差别到底是什么?
相关话题的讨论汇总
话题: emption话题: examples话题: user话题: any话题: library
进入Programming版参与讨论
1 (共1页)
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++ 党居然都没人理你 ... 搞不好看你题目都不知道你想问啥

1 (共1页)
进入Programming版参与讨论
相关主题
mutex和semaphore的差别到底是什么?how many ways in C++ to release a mutex?
c++ multi-thread 一问,C++的一个mutex问题
精华区翻出来的MS老题,thread safeVC++线程问题
boost drives me crazy!! Question!请教大家一道C的面试题
pthread_create inside a constructor怎么练习C++ multi-threading?
C++ Q05: pointer to constant variableC++ InitializeCriticalSection问题
Go adopts JavaScript’s idea of semicolon insertiondifference between: char** p and char*p[] ??
面试问题一问 (转载)VC++ release VS debug
相关话题的讨论汇总
话题: emption话题: examples话题: user话题: any话题: library