wangbojing
Repos
26
Followers
1525
Following
1

Events

Update README.md

Created at 3 weeks ago

Update README.md

Created at 3 weeks ago

Update README.md

Created at 4 weeks ago

Update README.md

Created at 4 weeks ago

Update README.md

Created at 4 weeks ago

Update README.md

Created at 4 weeks ago

Update README.md

Created at 4 weeks ago

Update README.md

Created at 4 weeks ago

Update README.md

Created at 4 weeks ago

Update README.md

Created at 4 weeks ago

Update README.md

Created at 4 weeks ago

Update README.md

My Private Thought with c/c++

Created at 4 weeks ago
create repository
wangbojing create repository
Created at 4 weeks ago
create branch
wangbojing create branch main
Created at 4 weeks ago
百度网盘 全都404了

已更新

Created at 1 month ago
issue comment
有个疑问

顺序执行,sleep超时以后 main才能往后面执行。

Created at 1 month ago
issue comment
add support for ucontext

merged your commit

Created at 2 months ago

add support for ucontext

Merge pull request #8 from piaodazhu/uctx_version

add support for ucontext

Created at 2 months ago
pull request closed
add support for ucontext

看了King老师讲协程框架的那期视频来拜读源码,受益匪浅,尝试在不改变原有特性的基础上增加NtyCo对ucontext的支持。

课程中提到协程的三种方案:汇编、setjmp和ucontext。汇编效率最高,但是需要为每个平台实现切换部分的汇编代码,目前也只支持了i386和x64。此前试过采用setjmp,但这种方法略坑,因为setjmp/longjmp只保存寄存器不保存栈,直接使用跳转,上下文则会丢失,而网上setjmp协程开源实现通常也没有很好地处理这个问题(比如还是要手动设置jmpbuf的栈指针,而jmpbuf在不同平台定义又不一样,导致代码不优雅)。ucontext恰好可以解决这个问题,它不像setjmp那样底层,不需要关心如何操作不同平台不同的寄存器。

因此有了本条PR,通过启用coroutine.h中的_USE_UCONTEXT宏,可以用ucontext方式替代汇编方式,以支持i386和x64以外的架构。

Created at 2 months ago

Update 面试题一.md

修改一处错别字

Merge pull request #6 from mophia/patch-1

fix[面试题一.md]: 修改一处错别字

Created at 2 months ago
pull request closed
fix[面试题一.md]: 修改一处错别字

修改一处错别字

Created at 2 months ago