Thread: 8 Cores
View Single Post
  #10 (permalink)  
Old 5th September 2008, 11:27 PM
forgie's Avatar
forgie forgie is offline
NSLog(@"%@", [self customTitle]);
 
Join Date: May 2005
Location: Melbourne
Posts: 3,962
View forgie's Twitter Page View forgie's Last.fm Playlist
Default

Quote:
Originally Posted by Brains View Post
Nope -- just about everything that's well-written can make use of however many cores there happen to be. Programs which make use of "threads" can do multiple things at the same time, if the resources are there to do it.

Old-school programming was self-contained, they would do one thing after another after another, and the OS would tell the program when it could have its share of the processor. With threads, a program can assign a sub-task to a thread and hand the thread to the OS; the OS will pick up the first available processing unit and then slot it into the multitasking system. If there is only the one processor, the thread has to complete before the program can send another. With multiple processors, multiple threads can run concurrently; its as if a program is actually a little OS of its own with several sub-programs running.
The only problem is, with any reasonably complex software project, threads break programmers brains. It all seems easy in trivial cases, but anything non-trivial in a GUI application can quickly become headache inducing for the programmer. That's where GCD and blocks come into the picture - "threading" (or the equivalent of threading), without the broken brain. Everyone wins! 10.6 FTW.
__________________
"The need is not for, say, half a million ¼-inch drill bits. The need is that there are ten million ¼-inch holes that need to be drilled." - Robert Noyce
forgecode.net
Reply With Quote