Integration Watch: Will actors be part of your repertoire?



Email    print   
February 3, 2009 —  (Page 1 of 2)
In my Nov. 15 column (“A new twist on threads”), I discussed the emerging importance of fine-grained parallelism. The gist of the column was that the traditional approach to parallelism, called coarse-grained parallelism, in which a specific task is assigned in toto to a single thread, leads to inefficient use of the processor. A better approach is to break up long tasks into a series of smaller tasks, then forward each of those to a thread pool that runs them efficiently and makes good use of all the underlying silicon resources.

The thread pool uses a work queue to hold these small tasks, and this queue assigns the task to the first available thread. This option provides inherent load balancing—all threads can work away. If one thread is held up (waiting for a slow process, such as disk I/O), it’s swapped out and another task is swapped in.

Thread pools provide an additional degree of efficiency: They determine at runtime the ideal number of threads to use. The optimal number is difficult to use in coarse-grained parallelism. For example, with a coarse-grained approach, if you break your application into six threads, then running it on a dual quad-core system will mean that two cores lie dormant. Thread pools, however, use all the available pipelines and distribute the smaller tasks over them. Therefore, you gain load balancing and nearly optimal usage of the processor resources.

Fine-grained parallelism, however, does not free developers from the challenges of coarse-grained threads. These include mutual exclusion for shared data items and the constant threat of deadlock (in which two threads wait on each other).

As a result, a new model for writing concurrent applications is emerging. It borrows a technique from academia. The key structure is called an actor. In its simplest form, an actor is a computation entity whose primary actions are performing operations that are passed to it, passing data to other actors, and creating new actors.

The operations that an actor performs locally are entirely local; they have no effects on other actors. To affect other actors, the actor must pass a message to them, including the data they need or the new instructions. For example, an actor might be created to multiply to matrices. The matrices and the multiplication function are passed to the actor. The resulting matrix might then be passed to another actor that collects results and processes it further.



Related Search Term(s): parallel processing

Pages 1 2 


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

Add comment


Name*
Email*  
Country     


  • Comment
Loading




close
NEXT ARTICLE
Harnessing the GPU for multicore processing
Parallel programming is becoming more commonplace, and companies are devising and revising products to meet demand 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