Skip to content

In order to learn the principle of context exchange. Implemented a user-level thread library in C language

Notifications You must be signed in to change notification settings

cuihovah/ul_thread

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

- 用户级线程库,我是用ucontext来做的。
- 目前只完成了线程的创建和切换。觉得东西虽然很小但是实现起来还是有许多地方要注意的。
- 我是在Ubuntu14.04 X86_64开发的,在这个平台上测试通过了。
- 不过在Mac OS X平台下就会出现许多奇怪的问题(暂时没解决)。
- 还有线程的结束也没有处理,越做觉得这个作业越不好做。
- 我本来想用setjmp和asm获得栈来实现的,
- 不过后期发现了ucontext也挺好用的。
- 开写完的时候才发现C99对于makecontext已经不支持了,
- 但是已经写到这个份上了,也只能硬着头皮往下写了。

About

In order to learn the principle of context exchange. Implemented a user-level thread library in C language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published