Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

协程支持自定义调度吗? #184

Open
sun123704 opened this issue May 6, 2022 · 2 comments
Open

协程支持自定义调度吗? #184

sun123704 opened this issue May 6, 2022 · 2 comments

Comments

@sun123704
Copy link

sun123704 commented May 6, 2022

tbox协程支持自定义调度吗,目前只看到通过tb_lo_coroutine_start()接口创建匿名协程并与schedule绑定,并且尚未看到如何使用tb_lo_coroutine_resume进行协程的自定义切换。
此外,多线程中若通过tb_lo_coroutine_start()接口在同一个schedule内创建协程,是否非线程安全?

@waruqi
Copy link
Member

waruqi commented May 6, 2022

不支持多线程,调度走 yield 。。

@sun123704
Copy link
Author

不支持多线程,调度走 yield 。。

想让suspended协程被重新调度起来,不是需要调用tb_lo_coroutine_resume()进行触发?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants