Grand Central Dispatch
Ok, exactly how is GCD in Snow Leopard going to work if you are using a concurrent programming language to start off. Especially if you are using the Erlang VM (Erlang and Reia)?
Will GCD get in the way?
Will it ignore these languages and let them do there thing but keep track of what they have done so it knows availability of resources?
Just wondering how that is going to work.
Will GCD get in the way?
Will it ignore these languages and let them do there thing but keep track of what they have done so it knows availability of resources?
Just wondering how that is going to work.
Comments
Ok, exactly how is GCD in Snow Leopard going to work if you are using a concurrent programming language to start off. Especially if you are using the Erlang VM (Erlang and Reia)?
Will GCD get in the way?
Will it ignore these languages and let them do there thing but keep track of what they have done so it knows availability of resources?
Just wondering how that is going to work.
http://lists.apple.com/mailman/listinfo
So it should have no effect on your current code (other than maybe the jobs scheduled with GCD would compete with yours for system resources... just like any other program). But if you decided to re-write your code in C, this could help you manage the threads as you parallelize (or in some cases as you serialize).
GCD requires "blocks, which at this point are C/C++/Obj-C only, but I am sure that this will be extended to other languages at some point (or by someone), but I don't have any idea if blocks are going to map well to Erlang and others. GCD is then a system resource that helps programmers schedule these blocks to be run on system resources in a way that pays attention to the hardware available on the computer at the time.
So it should have no effect on your current code (other than maybe the jobs scheduled with GCD would compete with yours for system resources... just like any other program). But if you decided to re-write your code in C, this could help you manage the threads as you parallelize (or in some cases as you serialize).
No this is good, What I was looking for, so standard C, C++, Obj-C and I am guessing any scripting language made from one or of these three will be handled by GCD. All other Function or Concurrent programming languages Scala and Clojure (for the JVM) and Erlang and Riea (for the Erlang VM) do there own things instead of going through GCD. But I am I write in guessing there is away for the GCD to see the usage of resources by non-GCD programs so that it does not to step on the non-GCD languages? And Visa Versa?
And my guess is that scripting languages will take a long time to include GCD, if they ever do. The reason is that GCD is only on MacOS X. And while it might be the biggest of the *nix variants, it is not the dominent one for any of those communities. And working GCD into the language would likely require some big changes, and doing that for MacOS X only is going to be a hard sell in those communities.
It's not some all-encompassing miracle that will affect everything. To use it, you have to be writing in C/C++/ObjC, and you have to actually call the GCD functions. They're pretty easy to use but not automatic.
If you don't use GCD, it won't change anything. Your code will run exactly as it did before.
Amorya
Essentially, GCD is a library of C functions that handle creating and using multiple threads for you. You (the programmer) pass in some code to be run, and the system runs it in an appropriate place.
It's not some all-encompassing miracle that will affect everything. To use it, you have to be writing in C/C++/ObjC, and you have to actually call the GCD functions. They're pretty easy to use but not automatic.
If you don't use GCD, it won't change anything. Your code will run exactly as it did before.
Amorya
Ok . . . now I get it I thought GCD was part of the Snow Leopard OS that was doing these things for you. Thats why I got confused how GCD would handle Functional / Concurrent languages since they already do it. Ok C Libraries that makes more sense.
Ok . . . now I get it I thought GCD was part of the Snow Leopard OS that was doing these things for you. Thats why I got confused how GCD would handle Functional / Concurrent languages since they already do it. Ok C Libraries that makes more sense.
Visit the LLVM Project.
http://llvm.org
Read up on the mailing lists and more.
Visit the LLVM Project.
http://llvm.org
Read up on the mailing lists and more.
LLVM is not required to use GCD as far as I know. They certainly had to add blocks support to LLVM, but that is only one part of what makes GCD tick. The other part is the OS service that schedules the blocks to be run (taking care of many of the difficult parts of multithreading, and certainly simplifying the job of figuring out the optimal multithreading setting for the hardware in use).
Note that this is not just a C library, it also requires an extension of C, and a OS service.
In fact, if Apple doesn't do this, I think they are possibly losing out on being able to sell computers to the growing number of people that are using languages like Erlang and clojure. I have several buddies that are into these languages, and their linux boxes, but if someone came out with an operating system that had a JVM that could use the resources of a GPU as well as the CPU they would switch pretty quickly (even if it came from Redmond, WA).
Apple has zero resources and zero interest to optimize third party products and to push developers away from their development environment.