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

看了RunLoop的文章,请教一个问题 #20

Closed
weiminghuaa opened this issue Jan 18, 2019 · 1 comment
Closed

看了RunLoop的文章,请教一个问题 #20

weiminghuaa opened this issue Jan 18, 2019 · 1 comment

Comments

@weiminghuaa
Copy link

我看到有些event loop的实现,是开启一个线程,使用while做一个死循环,在里面接收状态并处理,使用的是<sys/event.h>里面的kevent,比如这个:https://github.com/douban/DOUAudioStreamer/blob/master/src/DOUAudioEventLoop.m,
并没有使用线程自己的RunLoop。

这个需求能通过RunLoop实现吗,这两个是一个东西吗,我有点蒙圈了。求解!

@100mango
Copy link
Owner

这个概念是一样的。RunLoop本质上就是一个线程处理任务的模式。

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