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

关于最大线程数 #9

Open
kingnight opened this issue Aug 22, 2016 · 1 comment
Open

关于最大线程数 #9

kingnight opened this issue Aug 22, 2016 · 1 comment

Comments

@kingnight
Copy link

define MAX_QUEUE_COUNT 32

    case NSQualityOfServiceUserInteractive: {
        static dispatch_once_t onceToken;
        dispatch_once(&onceToken, ^{
            int count = (int)[NSProcessInfo processInfo].activeProcessorCount;
            count = count < 1 ? 1 : count > MAX_QUEUE_COUNT ? MAX_QUEUE_COUNT : count;
            context[0] = YYDispatchContextCreate("com.ibireme.yykit.user-interactive", count, qos);
        });
        return context[0];
    } break;

关于这段代码,有些疑问向您请教,比如iPhone6,返回count等于2,那么五种不同QOS类型,最多只会产生5*2=10个queues,不知道我的理解是否正确,这个最大值32的意义何在?

@ibireme
Copy link
Owner

ibireme commented Aug 25, 2016

这里只是给每个 poll 内的 queue 给一个上限值,并没有什么特殊含义。
除非在 有 32 线程以上的 CPU 上跑(双路至强E5?),不然这个值用不到。

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