Difference between revisions of "CSC352 Comparison threading to multiprocessing"

From dftwiki3
Jump to: navigation, search
(Experiment)
(Experiment)
 
Line 1: Line 1:
 +
<bluebox>
 +
This is a simple comparison of the execution times of the N-Queen program in a threaded version, and in a multiprocessing version.  This application is ideally parallel in that there is no communication required between threads or processes, except at the end when a solution has been found.  The program stops when the first solution is found.
 +
</bluebox>
 +
 +
<br />
 +
__TOC__
 +
 
===Experiment===
 
===Experiment===
  
Line 25: Line 32:
 
* [[Media:CSC352ComparisonMultiProcThreaded.xls.gz | spreadsheet]]
 
* [[Media:CSC352ComparisonMultiProcThreaded.xls.gz | spreadsheet]]
  
 +
===Another Comparison===
 +
 +
[http://www.python.org/dev/peps/pep-0371/ PEP 371] provides a nice collection of benchmarks comparing the execution times of threaded applications versus their multiprocessing equivalent.
 
<br />
 
<br />
 
<br />
 
<br />

Latest revision as of 09:22, 11 February 2010

This is a simple comparison of the execution times of the N-Queen program in a threaded version, and in a multiprocessing version. This application is ideally parallel in that there is no communication required between threads or processes, except at the end when a solution has been found. The program stops when the first solution is found.


Experiment

  • Ran Threaded and Multiprocessing versions of NQueens programs (see Category:Python for source code) for N ranging from 10 to 25.
  • Typical shell script:


#! /bin/bash
# multiprocessingNQueens.py

for i in {10..25}
do 
    echo $i
    time python ./mulitprocessingNQueens.py $i | grep user
done


CSC352ComparisonMultiprocessingThreadingNQueens.png

Another Comparison

PEP 371 provides a nice collection of benchmarks comparing the execution times of threaded applications versus their multiprocessing equivalent.