[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSOperationQueue thread pool size
From: |
John W Kennedy |
Subject: |
Re: NSOperationQueue thread pool size |
Date: |
Wed, 5 Feb 2014 11:26:53 -0500 |
User-agent: |
Unison/2.1.10 |
On 2014-02-05 09:22:28 +0000, Richard Frith-Macdonald said:
On 4 Feb 2014, at 19:10, Larry Campbell <lcampbel@akamai.com> wrote:
Is there a reason that NSOperationQueue's thread pool size is
hard-coded at eight? For threads that are, say, doing network I/O, it
would be very useful to use more than eight.
IIRC the only reason is that when I was developing and testing
behaviors on OSX, the system I was using seemed to run no more than 8
operations at a time, so it was a guess at an OSX compatible pool size.
For all I know this actually varies between different OSX versions or
even for different circumstances (I haven't seen any documentation
saying what the pool size should be).
It seems to me that, back when Snow Leopard came out, it was explained
that Grand Central Dispatch would adjust the maximum number of threads
according to the number of apparent (counting hyperthreading) cores
free to do work. Eight would therefore be the most likely number in a
typical testing environment (four hyperthreaded cores and no
substantial CPU load on any of them).
--
John W Kennedy
"Never try to take over the international economy based on a radical
feminist agenda if you're not sure your leader isn't a transvestite."
-- David Misch: "She-Spies", "While You Were Out"