A Parallelisation Tale of Two Languages

Antonio J. Tomeu, Alberto G. Salguero, Manuel I. Capel


There are several APIs (C+11, TBB, OpenMPI,... ) that properly support  code parallelism in any of the most used programming languages (C++, C\#,Java, Phyton,  or Erlang) in telecommunications industry nowadays, but it is a complicated issue for a novel programmer of multicores to decide which one to choose in order to get an application parallelized with high performance.

C++11 is the new ISO standard for C++, which offers atomic declaration of variables, load/store operators and supports portable multithreaded programming in this familiy of development languages.

Java SE has been including new primitives for doing high--level concurrency in Java programs from version 5.0 on. Currently, Java SE 8 also offers parallel syntactical constructs for new multicore
architectures programs, such as lambda functions  with an efficient tail recursion implementation or execution to future.

Within a similar historical context,  as in the Charles Dickens' A Tale of Two Cities, there may exist equivalent problems in two close--up places but they can be solved in a quite different way. In this respect, we are performing a systematic comparative study between two programming languages that are intensively deployed in industry today, probably due to their popular
parallel programming APIs, Java Concurrency Utilities and  C++11 Standard Library, respectively. We carry out a set of measurements to compare the execution time and performance (speedup) of parallel versions of  (a) Belousov-Zhabotinsky chemical reaction simulation with cellular automata and (b) Discrete 2D-Convolution.

Differently from other similar work in the field, we focus here more on foretelling performance results that different APIs are offering to non-specialized programmers than in low--level implementation details.


High-level concurrency API; multicore programming; parallel programming; simulation of physical phenomena; Belousov-Zhabotinsky’s reaction; parallel 2D convolution


Adamatzky, A., De Lacy, B. & Asai, T. Reaction-Diffusion Computers. Elsevier B. V., 2005.

Akhter, S.& Roberts, J. Multicore Programming Incresing Performance Through Sofware Multithreading. Intel Press, Digital Edition, 2006.

Alba, E. Parallel evolutionary algorithms can achieve super-linear performance. Information Processing Letters 82, 7-13, 2002.

Al Umairy, S., Van Amesfoort, A., Setija, I., Van Beurden, M. & Sips, H. On the Use of Small 2D Convolutions on GPUs. Lecture Notes in Computer Science, volume 6161, 52-64, 2012.

Ball, P. Designing the Molecular World: Chemistry at the frontier. Princeton University Press, 1994.

Bai, Q., Shao, Y., Pan, D., Zhang, Y. Liu, H. & Yao X. Parallel high-performance grid computing: capabilities and opportunities of a novel demanding service and business class allowing highest resource efficiency. Studies in health technology and informatics, 01/2010, 159, 264-71, 2010.

Bandman, O. Mapping Physical Phemomenon to CA-Models. Automata-2008. Theory and Applications of Cellular Automata, 381-395. Luniver Press, 2008.

C++ Reference. (http://en.cppreference.com/w/). 2014.

Deutsch, A. & Dorman, S. Cellular Automaton Modeling of Biological Pattern Formation. Characterizacion, Applications and Analysys. Birkauser Boston, 2005.

Fernandez, J. Java 7 Concurrency Cookbook. Packt Publishing, 2012.

Göetz, B., Peierls, T., Bloch, J., Bowbeer, J., Holmes, D. & Lea, D. Java Concurrency in Practice. Addison-Wesley, 2006.

Goram. A.K. & From, A. A Comparative analysis between parallale models in C/C++ and C#/Java. (http://kth.diva-portal.org/smash/get/diva2:648395/FULLTEXT01.pdf). 2013.

Hao W., Lu Z., Xu C., Yan L. & Yurong S. Quantifying and analyzing neighborhood configuration characteristics to cellular automata for land use simulation considering data source error. Earth Science Informatics, Volume 5, Issue 2, 77-86, 2012.

Java Platform, Standard Edition 8. API Specification (http://docs.oracle.com/javase/8/docs/api/). Oracle Corporation.

Lea, D. Programación Concurrente en Java. Principios y Patrones de Diseño. Addison Wesley, 2000.

Nagashima U., Hyugaji, S. Sekiguchi, S. Sato, M. & Hosoya, H. An experience with super-linear speedup achieved by parallel computing on a workstation cluster: Parallel calculation of density of states of large scale cyclic polyacenes. Parallel Computing, volume 21, issue 9, 1491-1504, 1995.

Mikhailov, A. S. and Showalter, K., Control of waves, patterns and turbulence in chemical systems. Physics Reports 425, 79-194, 2006.

Nefedev, K.V. & Peretyako, A.A. Superlinear Speedup of Parallel Calculation of Finite Number Ising Spins Partition Function. Proceedings of Third International Conference of High Performance Computing HPC-UA, 282-286, 2013.

Oaks, S. & Wong, H. Java Threads, 3rd Edition. O'Reilly, 2004.

Petrou, M & Petrou, C. Image Processing: The Fundamentals. John Wiley & Sons. 2010

Rauber, T. & Rünger, G. Parallel Programming for Multicore and Cluster Systems. Second Edition. Springer-Verlag, 2012.

Robbins, K. & Robbins, S. Practical Unix Programming. A Guide to Concurrency, Communication and Multithreading. Prentice Hall, 1996.

Subramanian, V. Programming Concurrency on the JVM: Mastering Synchronization, STM and Actors. The Pragmatic Programmers, 2011.

Sharifulina, A. & Elokhin, V. Simulation of Heterogeneous Catalytic Reaction by Asynchronous Cellular Automata on Multicomputer. Parallel Computing Technologies. Lectures Notes in Computer Science, volume 6873, 204-209, 2011.

Williams, A. C++ Concurrency in Action. Practical Multithreading. Manning, 2012.

Wadhawam, M., Midha, P. Kaur, I. & Kaur, S. An Investigation of the Tools of Seismic Data Processing. Proceedings of the 8th Biennial International Conference & Exposition on Petroleum Geophysics, 303-309, Hyderabad, 2010.

Full Text: PDF