Concurrent programming languages Go and C++ Threading Building Blocks (TBB) offer high level parallel programming mechanisms built on top of threads. Go goroutines and TBB task classes are used as the computation units that are mapped to physical threads on multi-core processors. The synchronization mechanisms in Go and TBB are the channel and the task scheduler, respectively. We utilized these mechanisms to implement a parallel version of the optimal binary search tree dynamic programming algorithm in Go and TBB. Both implementations tile the iteration space and construct and evaluate a direct acyclic task graph for optimal parallelism without over constraints. We compared Go and TBB speedup and performance to create a benchmark of how efficient these two languages are at evaluating a direct acyclic task graph. Our experimental results show that the overhead of task scheduling and synchronization in TBB is much smaller than Go and that the overall performance of TBB is 1.6 to 3.6 times faster than Go. TBB provided super linear speedup under certain conditions, which we attribute to the majority of the test data being cached and the negative cost of task scheduling and synchronization. We conclude that TBB task scheduling and synchronization is faster than Go and that the top speedup of TBB is greater than that of Go.
[1]
Margaret Martonosi,et al.
Parallelization libraries: Characterizing and reducing overheads
,
2011,
TACO.
[2]
Peiyi Tang,et al.
Multi-Core Parallel Programming in Go
,
2010
.
[3]
Michael J. Quinn,et al.
Parallel programming in C with MPI and OpenMP
,
2003
.
[4]
James Reinders,et al.
Intel threading building blocks - outfitting C++ for multi-core processor parallelism
,
2007
.
[5]
Allen Van Gelder,et al.
Computer Algorithms: Introduction to Design and Analysis
,
1978
.
[6]
Sara Baase,et al.
Computer algorithms - introduction to design and analysis (2 ed.)
,
1988
.
[7]
Nicholas Chen,et al.
Patterns for cache optimizations on multi-processor machines
,
2010,
ParaPLoP '10.
[8]
Clifford Stein,et al.
Introduction to Algorithms, 2nd edition.
,
2001
.
[9]
Vivek Sarkar,et al.
Reducing task creation and termination overhead in explicitly parallel programs
,
2010,
2010 19th International Conference on Parallel Architectures and Compilation Techniques (PACT).
[10]
Barry Wilkinson,et al.
Parallel programming
,
1998
.