Why NSOperationQueue create new threads instead of using the older ones?

The queue itself is initialized as follows:

  init(dependency: Dependency = (.global(qos: .userInitiated), .shared)) {
    (underlyingQueue, session) = dependency
    
    fetchQueue = PSOperationQueue()
    fetchQueue.underlyingQueue = underlyingQueue
    fetchQueue.maxConcurrentOperationCount = 5
  }

The problem is that after the first batch of operations added to this queue and successfully completed, a new batch of operations starts on other created threads. The question is why it doesn't use the same threads it used for the first batch of operations.

Illustration:
Threads Fetch(2), 3, 4, 5 used for first batch of operation;
Threads Fetch(9), 10, 12 used for second batch of operation;

Terms of Service

Privacy Policy

Cookie Policy