I think you are missing the whole point. Parallel programming has been around for ages in threading. The issue with threading is that too many of them can actually hurt performance. So, if you have a core2duo machine, the optimum number of threads is probably 2, but if you have 16 cores, 16 threads will be best. Programming for different number of cores is possible but painful and hard. What central dispatch does, is creating this work queues and actually using as many threads as is beneficial to your specific hardware, taking the issue away from the programmer to optimize processes.
@joule79: You're not quite right. "Moving things off the main thread" should be done whenever there's a task that might take a long time, like spell checking or contacting an update server. Doesn't matter how many cores you do or don't have. "Splitting up the main thread to benefit from parallelism" is aided by knowing how many simultaneous threads can run.
""valid concern on Windows that a mixture of parallel apps won't cooperate with each other as much," so you could wind up with a situation where say, four apps try to use all 16 cores in your machine, when you'd rather they split up, with say one app using eight cores, another using four, and so on. GCD addresses that problem at the system level"
That is not a valid concern, you don't overload the CPUs in that way the intruction set on the CPU stops it from happening, someone is giving you a mixed version of Windows.
You also miss the common problem with GCD you can only multi-thread as well as GCD can, if Adobe bring out a new version of PS that can multi-thread better than GCD then Windows gets that functionality and mac user do without.
Much like 64 bit PS.
so you could wind up with a situation where say, four apps try to use all 16 cores in your machine, when you'd rather they split up, with say one app using eight cores, another using four, and so on.
What's wrong with the app using up all cores of the machine? Right now, there are computers that only has a single core and capable of running several apps. It's not like every app is utilizing each CPU at 100% all the time. Therefore, if you spread the apps across all cores at the same time, you get better utilization per core.
3:48 PM
@ripfire: It's better to have an application use core "A" to do one of it's tasks, and use the second core for task "B" simultaneously (which isn't being done.
It's like if you have a group of people helping you move out of your house, and everyone can move stuff by themselves and load it into a their own car.
Threading is similar in the sense that those 2 tasks are running simultaneously, but instead they are both being done on the same core/processor rather than multiple ones.
This would be like having the same group of people helping you move, but you only have one car to load everything into (or have multiple cars, but can only load the next car when the first has been filled).
Currently apps can thread, and will eventually use up multiple cores/processors, but they can't specifically use separate ones simultaneously (some can use multi processors, but not so much with the cores right now), and that's what this is about. (15th edit) Like what you said about single processor machines using multiple apps: the reason there is a separate graphics card for video processing is because it's efficient to keep those apart, same essential idea if you have multiple processor/cores being able to split up apps accordingly and properly it would be "mo' better".
Very few, if any, applications need to use all of the cores on a machine (or can at this time do so efficiently), so instead of multiple apps that are just using everything at once and on top of the next, it becomes far more efficient (in many ways including power consumption and task execution) to have one app using this core, and one app using the other cores.
Your method is fine (and how it's been forever now), but this method is better. :)
This is definitely the easiest read I've found explaining the differences between these approaches. Fantastic job making something so technical very approachable.
It would have been nice, though, if you had mentioned some of the other initiatives such as OpenMP and Charm++ and others that are more accessible to curious developers.
"Ok, let's see what we have here. Step 1, put this value in this register. Next step 2, multiply this register with this data..." [few nanoseconds later] "Alright, step 221 multiply the two and put it back to memory... Hmm. What the... Hey Bob, are you running the code on offset 88? You are?? Goddammit... *sigh* Ok forget it. let's run something else.."
Sounds like my entire operating systems class back in college. If you would have busted out the word semaphore I would have probably went into violent flashbacks.
Matt, you get my eternal gratitude for starting the article mentioning the Amiga as the start of graphics co-processors. It is exciting to have a platform that will help blaze the way on finding solutions to our multi-processor problems. While it might be much easier to split up a graphics task into a million simultaneous pieces, the mother-lode will be to find that same process for all programming, and I have no doubt there are more than a few minds working on that problem right now.
08/27/09
looks like the name 'snow leopard' is a good fit -- rare and fast.
there's a good article on the ever-feline mac os names over here: http://onthebutton.wordpress.com/2009/08/26/apple-snow-leopard/ worth a read.
08/27/09
08/29/09
08/27/09
That is not a valid concern, you don't overload the CPUs in that way the intruction set on the CPU stops it from happening, someone is giving you a mixed version of Windows.
You also miss the common problem with GCD you can only multi-thread as well as GCD can, if Adobe bring out a new version of PS that can multi-thread better than GCD then Windows gets that functionality and mac user do without.
Much like 64 bit PS.
08/27/09
08/27/09
so you could wind up with a situation where say, four apps try to use all 16 cores in your machine, when you'd rather they split up, with say one app using eight cores, another using four, and so on.
What's wrong with the app using up all cores of the machine? Right now, there are computers that only has a single core and capable of running several apps. It's not like every app is utilizing each CPU at 100% all the time. Therefore, if you spread the apps across all cores at the same time, you get better utilization per core.
08/27/09
@ripfire: It's better to have an application use core "A" to do one of it's tasks, and use the second core for task "B" simultaneously (which isn't being done.
It's like if you have a group of people helping you move out of your house, and everyone can move stuff by themselves and load it into a their own car.
Threading is similar in the sense that those 2 tasks are running simultaneously, but instead they are both being done on the same core/processor rather than multiple ones.
This would be like having the same group of people helping you move, but you only have one car to load everything into (or have multiple cars, but can only load the next car when the first has been filled).
Currently apps can thread, and will eventually use up multiple cores/processors, but they can't specifically use separate ones simultaneously (some can use multi processors, but not so much with the cores right now), and that's what this is about. (15th edit) Like what you said about single processor machines using multiple apps: the reason there is a separate graphics card for video processing is because it's efficient to keep those apart, same essential idea if you have multiple processor/cores being able to split up apps accordingly and properly it would be "mo' better".
Very few, if any, applications need to use all of the cores on a machine (or can at this time do so efficiently), so instead of multiple apps that are just using everything at once and on top of the next, it becomes far more efficient (in many ways including power consumption and task execution) to have one app using this core, and one app using the other cores.
Your method is fine (and how it's been forever now), but this method is better. :)
08/27/09
08/27/09
It would have been nice, though, if you had mentioned some of the other initiatives such as OpenMP and Charm++ and others that are more accessible to curious developers.
08/27/09
08/27/09
08/27/09
08/27/09
08/27/09
08/27/09
08/27/09
08/27/09
08/27/09
Kudos
08/27/09
08/27/09
05/13/09