• Your favorite

    Apple

    ,

    iPhone

    ,

    iPad

    ,

    iOS

    ,
    Jailbreak
    , and
    Cydia
    site.
  • Grand Central Dispatch: building for the future


    Much has been made of the fact that there are not a lot of new features in Snow Leopard from a user point of view. While it's true that from a marketing standpoint Snow Leopard could have made a much bigger splash, especially this close to the Windows 7 release, Apple deserves some real credit for doing the right thing from an engineering point of view. Snow Leopard fixes a lot of what was broken in Leopard, provides real speed and usability improvements, and most importantly builds in solid support for technology - such as multi-core processors - that will be central to computing in the years to come.

    I want to take a brief look at one of the most significant new "under-the-hood" elements of Snow Leopard: the Grand Central Dispatch (GCD) model. GCD provides a set of extensions to common programming languages - specifically C, C++ and Objective C - that make it easier to take advantage of the multiple cores on modern processors. Cores are essentially separate computing engines located on the same chip that allow tasks to be handled in parallel - simultaneously - rather than one at a time.

    The problem with this approach in software - called task parallelism - is that it requires a lot of challenging work for the programmer. Computing jobs need to be broken up intelligently into tasks, and these tasks need to be farmed out to separate cores. That's being handled in threads by modern code. Programmers need to ensure that each thread has the resources it needs, that it locks the data that it's using and releases it when it's done, and that no other threads are using the resources at the same time. Complicating all of this is the fact that the programmer has no way of knowing whether the code will be run on a dual-core or quad-core chip... or some future William Gibson thousand-core black-ice über-mainframe.

    GCD allows the programmer to define units of code and data into Blocks, which can then be put on Queues for scheduling. The system then handles execution of all the scheduled Queues in an efficient, coordinated way, rather than letting individual programs grab resources willy-nilly. Apple's clearly invoking Grand Central Station to suggest the efficient flow of large volumes of traffic. It's an apt metaphor: the amount of parallelizable code will likely grow enormously to take advantage of faster chips with more cores. Leaving thread management up to individual programs, as in the status quo, will likely lead to worse and worse pile-ups.

    The Windows 7 release will certainly be a big media splash. Hopefully, we'll also see real improvements in the underlying technology on which most of the world's PCs depend. It will be interesting to see which architecture best takes advantage of future processors as the technology continues to advance.
    This article was originally published in forum thread: Grand Central Dispatch: building for the future started by Paul Daniel Ash View original post
    Comments 11 Comments
    1. rwin84's Avatar
      rwin84 -
      Snow Leopard, arguably one of the best OS of all time. Well thought out and executed.

      1
    1. tattoojack's Avatar
      tattoojack -
      thank god for apples
    1. mdc929's Avatar
      mdc929 -
      interesting especially since this stuff is going to be covered in my computer science class
      thanks paul i never wouldve known what this meant for snow leopard without you
    1. J_Marley's Avatar
      J_Marley -
      Yes, I agree this is great news, but the issue still stands that there are so few companies and programmers willing to take the time to put together a decent multi-core utilized application that at this point there isn't a need. Kudos for aaple thinking ahead, but where is this truly going to lead without companies stepping up the quality of their products?
    1. n00neimp0rtant's Avatar
      n00neimp0rtant -
      Honestly, I thought OpenCL, the idea of using a graphic processor for non-graphic tasks whenever it is in low to no usage, was a totally revolutionary idea. Think about how big of a waste it is to have a superfast graphic processor, capable of performing trillions of operations a second, and only using it for 3D gaming or intense video editing.
    1. sziklassy's Avatar
      sziklassy -
      Quote Originally Posted by J_Marley View Post
      Yes, I agree this is great news, but the issue still stands that there are so few companies and programmers willing to take the time to put together a decent multi-core utilized application that at this point there isn't a need. Kudos for aaple thinking ahead, but where is this truly going to lead without companies stepping up the quality of their products?
      It has to start with the OS... "if you build it they will come" LOL
    1. Poseidon79's Avatar
      Poseidon79 -
      Quote Originally Posted by J_Marley View Post
      Yes, I agree this is great news, but the issue still stands that there are so few companies and programmers willing to take the time to put together a decent multi-core utilized application that at this point there isn't a need. Kudos for aaple thinking ahead, but where is this truly going to lead without companies stepping up the quality of their products?
      Isn't a need? Every (new) computer on the market being sold these days has a multi-core chip. I would say the need has never been greater. 2 years ago it would have been ridiculous when multi-core was cutting edge... but main stream now.
    1. smuggler's Avatar
      smuggler -
      'pretiate it, very informing, good arguing tools when bragging about sn0w le0pard
    1. AAAARRRRRRGGGGG's Avatar
      AAAARRRRRRGGGGG -
      Quote Originally Posted by Poseidon79 View Post
      Isn't a need? Every (new) computer on the market being sold these days has a multi-core chip. I would say the need has never been greater. 2 years ago it would have been ridiculous when multi-core was cutting edge... but main stream now.
      and to drive this home even further, our calculations per second per dollar average has been increasing pretty much exponentially since the beginning of computing. we need to strap in for increasingly accelerating advances in how we handle information.
    1. nevarDeath's Avatar
      nevarDeath -
      I definately think modmyi could benefit from more slightly technical articles like this! Thanks for the interesting read, I had no idea!
    1. unixman84's Avatar
      unixman84 -
      Quote Originally Posted by J_Marley View Post
      Yes, I agree this is great news, but the issue still stands that there are so few companies and programmers willing to take the time to put together a decent multi-core utilized application that at this point there isn't a need. Kudos for aaple thinking ahead, but where is this truly going to lead without companies stepping up the quality of their products?
      Yes i see, its a problem i see as well. todays focus is looking good not doing good. This tech is in its infancy and i am certain that in due time it will blossom like many other ideas from apple into something bigger. we dont have the answer yet but its coming. and i see it coming soon.