Hardware Helpers
Apple spent a long time rewriting large portions of OS X for Snow Leopard - the focus has been very much on improving its responsiveness and speed. Although previous versions of OS X have supported 64-bit computing in various capacities, Snow Leopard takes things further than before.
The kernel has been transitioned over to 64-bits for the first time, meaning there's now a complete 64-bit operating environment for applications and theoretical support for up to 16 exabytes of RAM. There is, of course, support for older Core Duo processors as well via a 32-bit operating mode, as they didn't have support for Intel's EM64T extensions. Snow Leopard's primary operating mode uses x86-64 extensions, though.
In addition to the move to 64-bit computing, both Intel and AMD have been shipping multi-core processors for a number of years. Many applications are not easily parallelised, so Apple has developed a task parallelisation technology that will be introduced with Snow Leopard.
It's known as Grand Central Dispatch (GCD) and it works by allowing specific tasks in a program that can be parallelised to be divided into blocks. These blocks are queued up for execution and then, depending on the availability of resources, they are scheduled for execution on available processing cores.
The GCD uses threads at the low level, like any other parallelisation technology, but it moves the responsibility away from the developer because they shouldn't need to worry about how their application's workload is allocated across available threads.
Blocks in the GCD can either be used to create work items that are placed in a queue, or can be assigned to event sources. If the latter is true, a work unit is made from the block and then placed in the appropriate queue when the event is triggered. Apple reckons that this is quicker and more efficient than creating a thread whose purpose is to wait for an event to be triggered.
Apple has also been one of the biggest driving forces behind OpenCL and so it's no surprise to see that native support is embedded into Snow Leopard. It enables developers to easily code applications to take advantage of the GPU for general computing tasks, much like DirectX Compute and Nvidia's C for CUDA.
OpenCL optimises applications and adjusts the flow of work to best suit the available processing power - it can balance applications across both the CPU and GPU. What's more, it's a C-based programming language with a familiar structure for developers and, like the Grand Central Dispatch, it handles threading responsibilities so that the programmer doesn't have to worry about what can often be a complex task at the best of times.
Apple reckons that most applications don't need to be completely rewritten to take advantage of OpenCL's GPU accelerated goodness. Instead, the company says that developers only need to re-write the performance intensive parts of their apps using OpenCL, leaving the rest of the code as-is. We're pretty excited about OpenCL in general and we look forward to seeing how application developers choose to use these new capabilities.
Want to comment? Please log in.