Integration Watch: A new twist on threads



Email    print   
November 15, 2008 —  (Page 1 of 3)
In 2004, Intel asked me to co-author a book for Intel Press on “Programming with Hyper-Threading Technology.” The resulting work was a comprehensive survey of parallel programming tools and APIs, with lots of how-to code and specific advice for programming on Intel hyperthreading chips. In the discussion of resource allocation, I presented numbers from my own investigations that supported the common wisdom regarding the optimal number of threads to use—namely, one thread per execution pipeline.

On hyperthreaded processors, as on today’s Core Duo chips, that meant two threads per processor. Similarly, on quad-core chips, the number would be four threads per processor. Using fewer threads leaves some processor resources to lie fallow while waiting for work; using more requires some threads to wait while others execute. So, a 1:1 mapping between threads and execution pipelines is just about perfect, both conceptually and in practice.

This ratio holds true if you’re writing parallel threads that keep the pipelines busy 100% of the time. In the dawning era of manycore processors, however, keeping many threads busy the whole time is a highly difficult task. What to do?

The answer, surprisingly, is to use smaller workloads, broken up over many more threads than there are pipelines. The overarching concept is that the smaller chunks of work can be scheduled for work whenever and however the OS scheduler dictates. If the scheduler is optimized for parallel work, it can load-balance very effectively with this approach, in a way that it could not with the older, 1:1 thread/processor assignments.

Consider a quad-core system. Under the classic approach, it would ideally support four threads of simultaneous execution. If one thread encountered a pause, however, its resources would lie unused until the pause ended. Another thread, working at 100%, could not offload work to the paused thread’s execution resources.

Now suppose the original workload had been broken up into more than four threads. Another thread could then be swapped in for the paused thread, and execution could continue apace. Situations in which there are more threads than pipelines can thus create the opportunity for load balancing.



Related Search Term(s): multicore, Intel

Pages 1 2 3 


Share this link: http://sdt.bz/33046
 
Most Read Latest News Blog Resources

Add comment


Name*
Email*  
Country     


  • Comment
Loading




close
NEXT ARTICLE
Intel updates and expands multicore development tools
New bundles of updated parallel and threading tools are targeted at C and Fortran developers, among others Read More...
 
 
 
 
News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 

Download Current Issue
FEBRUARY 2012 PDF ISSUE

Need Back Issues?
DOWNLOAD HERE

Want to subscribe?


 
blogs tab
Are you at risk for burnout?
Burnout is a severe problem and it can strike at any time. Here's how to tell if you are nearing the edge.
02/09/2012 02:16 PM EST

Agility, mom, and apple pie
If we're to evaluate the state-of-the-art in software development, we should start with the values espoused in the Agile Manifesto.
02/07/2012 11:57 AM EST

RIM woos developers with free tablet
How do you get more apps ported to the BlackBerry PlayBook? By giving every developer a free tablet, of course!
02/04/2012 01:57 PM EST

GitHire: Use Headhunters to Find Your Perfect Programmer
Are you a hiring manager tired of scouring the job boards? Check out this new service that will find 5 people interested in your jobs.
02/03/2012 12:17 PM EST

Facebook claims hacker cred
Facebook's SEC S-1 filing form includes a short essay on the Hacker Way by Mark Zuckerberg himself.
02/02/2012 08:26 AM EST

Ryan Dahl steps down
Ryan Dahl, creator of Node.js, steps back from his position as gatekeeper for the project.
02/01/2012 04:58 PM EST

 
Events calendar tab
2/13/2012 to 2/16/2012
Santa Clara
TechWeb

2/26/2012 to 2/29/2012
San Francisco
BZ Media

2/27/2012 to 3/2/2012
San Francisco
RSA

3/4/2012 to 3/7/2012
Las Vegas
IBM Tivoli

3/5/2012 to 3/9/2012
San Francisco
TechWeb