Skip to content

关于最大线程数 #9

@kingnight

Description

@kingnight

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的意义何在?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions