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

疑惑: 真的能保证执行顺序吗 #7

Open
FoneG opened this issue Jun 15, 2021 · 1 comment
Open

疑惑: 真的能保证执行顺序吗 #7

FoneG opened this issue Jun 15, 2021 · 1 comment

Comments

@FoneG
Copy link

FoneG commented Jun 15, 2021

仔细看了代码,认为YBTaskScheduler的执行顺序逻辑并不可用。

双线队列固然能保证每个block任务在queue中是有序的(FIFO、LIFO、优先级),但最后执行的时候是在多个串行队列异步执行的。 然而多个异步线程之间的执行顺序其实是不能保证的,单纯的任务保存有序没有特别的价值。

@FoneG FoneG changed the title 为什么自己单独维护一个YBTSDefaultConcurrentQueue 疑惑: 真的能保证执行顺序吗 Jun 17, 2021
@FoneG
Copy link
Author

FoneG commented Jun 17, 2021

另外系统的NSOperationQueue完全能支持实现线程数量控制,还能在operation之间添加依赖,不需要自己额外维护一个串行队列列表。

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

1 participant