Re: Does GCD auto-limit concurrent tasks to number of cores?
Re: Does GCD auto-limit concurrent tasks to number of cores?
- Subject: Re: Does GCD auto-limit concurrent tasks to number of cores?
- From: Mike Abdullah <email@hidden>
- Date: Thu, 09 Apr 2015 20:36:39 +0100
> On 9 Apr 2015, at 20:26, Carl Hoefs <email@hidden> wrote:
>
> Wonderful! Thank you for clearing this up for me!
> -Carl
>
>>
>>> On Apr 9, 2015, at 12:07, Carl Hoefs <email@hidden>
>>> wrote:
>>>
>>> OS X 10.10
>>>
>>> I have a highly CPU-bound project that parallelizes well. A small case
>>> has
>>> about 5000 tasks that can execute concurrently (max is ~100,000). I
>>> would
>>> like to use GCD queues to take advantage of the 24 cores I have on my
>>> MacPro. Does GCD automatically limit the number of tasks that become
>>> current on its queues to the number of cores (hw.logicalcpu)?
>>
>> Yes.
Major caveat to be aware of though:
GCD’s scheduling is based purely on CPU usage. If your scheduled work gets held up by some other limit, such as disk access, GCD will spin up another worker thread to do something else off of your queue. Thus it’s possible to end up with huge numbers of threads going at once, mostly blocked, if your workload doesn’t suit GCD.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden