Abstract
With the arrival of multi-cores for mainstream desktop systems, developers must invest the effort of parallelising their applications in order to benefit from these systems. However, the structure of these interactive desktop applications is noticeably different from the traditional batch-like applications of the engineering and scientific fields. We present Parallel Task (short ParaTask), a solution to assist the parallelisation of object-oriented applications, with the unique feature of including support for the parallelisation of graphical user interface applications. In the simple, but common, cases concurrency is introduced with a single keyword. ParaTask sets itself apart from the many existing object-oriented parallelisation approaches by integrating different task types into the same model and its careful adherence to object-oriented principles. Due to the wide variety of parallelisation needs, ParaTask provides intuitive support for dependence handling, non-blocking notification and exception handling in an asynchronous environment as well as supporting a flexible task scheduling runtime (currently work-sharing, work-stealing and a combination of the two are supported). The performance is excellent compared to traditional Java parallelisation approaches, shown using a variety of different workloads.
Similar content being viewed by others
Notes
Preliminary proof-of-concept development of ParaTask was presented here [15].
To download the latest ParaTask and other related resources, visit www.parallelit.org.
The term task-safe (as opposed to thread-safe) is used to denote parallel-safe code since ParaTask is a tasking-model (not a threading-model). This means that programmers think in terms of tasks rather than threads (explained further in Sect. 4.2.2).
I/O tasks are an intentional exception, but not a general solution to the here discussed issue.
The TaskID is needed if the method being notified accepts TaskID as parameter, otherwise it is omitted. This ensures at compile time that the correct method signature is used.
Cilk Art’s Cilk++ removes this requirement, since all functions are compiled by default to use the Cilk calling convention.
References
Creeger, M.: Multicore CPUs for the masses. Queue 3(7), 63–64 (2005)
Bull, J.M., Smith, L.A., Pottage, L., Freeman, R.: Benchmarking Java against C and Fortran for scientific applications. In: JGI ’01: Proceedings of the 2001 Joint ACM-ISCOPE Conference on Java Grande, New York, NY, USA. ACM, pp. 97–105 (2001)
TIOBE Software BV (2008) TIOBE programming community index. http://www.tiobe.com/tpci.htm
Sutter, H., Larus, J.: Software and the concurrency revolution. Queue 3(7), 54–62 (2005)
Barroso, L.A.: The price of performance. Queue 3(7), 48–53 (2005)
Lea, D.: Concurrent Programming in Java: Design Principles and Patterns, 2nd edn. Addison-Wesley, Reading, MA (1999)
Ludwig, E.: Multi-threaded user interfaces in Java. PhD thesis, University of Osnabrück, Germany MaY 2006
Hyde, P.: Java Thread Programming. Sams, Indianapolis, IN (2001)
Goetz, B., Peierls, T., Bloch, J., Bowbeer, J., Holmes, D., Lea, D.: Java Concurrency in Practice. Addison-Wesley Professional, Reading, MA (2006)
Muller, H., Walrath, K.: Threads and swing. The swing connection. http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html (2008)
Buddhikot, M., Goil, S.: Throughput computing with chip multithreading and clusters. In: Lecture Notes in Computer Science, vol. 3769, pp. 128–136 (2005)
Oaks, S., Wong, H.: Java Threads, 3rd edn. O’Reilly Media Inc, Sebastopol, CA (2004)
Harbulot, B., Gurd, J.R.: Using AspectJ to separate concerns in parallel scientific Java code. In: AOSD ’04: Proceedings of the 3rd International Conference on Aspect-oriented Software Development, New York, NY, USA. ACM Press, pp. 122–131 (2004)
Philippsen, M., Philippsen, M.: A survey of concurrent object-oriented languages. Concurr. Practice Exp. 12(10), 917–980 (2000)
Giacaman, N., Sinnen, O.: Parallel task for parallelizing object-oriented desktop applications. In: IEEE International Workshop on Parallel and Distributed Scientific and Engineering Computing (PDSEC) held in conjunction with 24th IEEE International Parallel and Distributed Processing Symposium (IPDPS’10), Atlanta, USA (2010)
Microsoft.: Parallel extensions to the .NET framework community technology preview (CTP), June 2008
Oracle.: java.util.concurrent ExecutorService. http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ExecutorService.html (2010)
Blumofe, R.D.: Executing multithreaded programs efficiently. Ph.D. thesis, Massachusetts Institute of Technology (1995)
Robert, J., Halstead, H.: Multilisp: a language for concurrent symbolic computation. ACM Trans. Program. Lang. Syst. 7(4), 501–538 (1985)
Sutter, H.: Interrupt politely. Dr. Dobb’s Journal, April 2008
Fisher, A.L., Ghuloum, A.M.: Parallelizing complex scans and reductions. In: PLDI ’94: Proceedings of the ACM SIGPLAN 1994 Conference on Programming Language Design and Implementation, New York, NY, USA. ACM, pp. 135–146 (1994)
Giacaman, N., Sinnen, O.: Parallel iterator for parallelising object oriented applications. In: The 7th WSEAS International Conference on Software Engineering, Parallel and Distributed Systems (SEPADS ’08). UK, Cambridge (2008)
Carver, R.H., Tai, K.-C.: Modern multithreading. Wiley, London (2006)
Nokia Corporation.: Signals & slots. http://qt-project.org/doc/qt-4.8/signalsandslots.html (2011)
Gregor, D.: Boost signals. http://www.boost.org/doc/libs/1_49_0/doc/html/signals.html (2004)
Weisfeld, M.: The Object-oriented Thought Process, 3rd edn. Addison-Wesley Professional, Reading, MA (2008)
Matsuoka, S., Yonezawa, A.: Analysis of Inheritance Anomaly in Object-oriented Concurrent Programming Languages. Research Directions in Concurrent Object-oriented Programming, Cambridge, MA, USA. MIT Press, pp. 107–150 (1993)
Milicia G., Sassone V.: The inheritance anomaly: ten years after. In: SAC ’04: Proceedings of the 2004 ACM Symposium on Applied Computing, New York, NY, USA. ACM, pp. 1267–1274 (2004)
Goodenough, J.B.: Exception handling: issues and a proposed notation. Commun. ACM 18(12), 683–696 (1975)
Zakhour, S., Hommel, S., Royal, J., Rabinovitch, I., Risser, T., Hoeber, M.: The Java Tutorial: A Short Course on the Basics, 4 edn. Prentice Hall, Englewood Cliffs, NJ (2006)
Sun Microsystems.: JavaCC Home. https://javacc.dev.java.net/ (2009)
Sinnen, O.: Task Scheduling for Parallel Systems. Wiley, London (2007)
Acar, U.A., Blelloch, G.E., Blumofe, R.D.: The data locality of work stealing. In: SPAA ’00: Proceedings of the Twelfth Annual ACM Symposium on Parallel Algorithms and Architectures, New York, NY, USA. ACM, pp. 1–12 (2000)
Lu, W., Gannon, D.: Parallel XML processing by work stealing. In: SOCP ’07: Proceedings of the 2007 Workshop on Service-oriented Computing Performance: Aspects, Issues, and Approaches, New York, NY, USA. ACM, pp. 31–38 (2007)
Burton, W.F., Sleep, R.M.: Executing functional programs on a virtual tree of processors. In: FPCA ’81: Proceedings of the 1981 Conference on Functional Programming Languages and Computer Architecture, New York, NY, USA. ACM, pp. 187–194 (1981)
Blumofe, R.D., Leiserson, C.E.: Scheduling multithreaded computations by work stealing. J. ACM 46(5), 720–748 (1999)
Blumofe, R.D., Papadopoulos, D.: The performance of work stealing in multiprogrammed environments (extended abstract). ACM SIGMETRICS Perform. Eval. Rev. 26(1), 266–267 (1998)
Guo, Y., Barik, R., Raman, R., Sarkar, V.: Work-first and help-first scheduling policies for async-finish task parallelism. In: IEEE International Symposium on Parallel and Distributed Processing (IPDPS 2009) (2009)
Campbell, P.J.: Gauss and the eight queens problem: a study in miniature of the propagation of historical error. Historia Mathematica 4(4), 397–404 (1977)
Sutter, H.: The pillars of concurrency. Dr. Dobb’s Journal, August 2007
Microsoft.: MSDN library, improving ASP.NET performance. http://msdn.microsoft.com/en-us/library/ff647787.aspx (2012)
Seow, S.C.: Designing and Engineering Time: The Psychology of Time Perception in Software. Addison-Wesley, Reading, MA (2008)
Sun Microsystems Inc.: Concurrency in swing. The Java tutorials. http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html (2008)
Briot, J.-P., Guerraoui, R., Lohr, K.-P.: Concurrency and distribution in object-oriented programming. ACM Comput. Surv. 30(3), 291–329 (1998)
Chandra, R., Gupta, A., Hennessy, J.L.: COOL: an object-based language for parallel programming. Computer 27(8), 13–26 (1994)
Hewitt, C.: Viewing control structures as patterns of passing messages. Artif. Intell. 8, 323–364 (1977)
Agha, G.: Actors: a model of concurrent computation in distributed systems. MIT Press, Cambridge, MA (1986)
Blumofe, R.D., Joerg, C.F., Kuszmaul, B.C., Leiserson, C.E., Randall, K.H., Zhou, Y.: Cilk: an efficient multithreaded runtime system. In: PPOPP ’95: Proceedings of the Fifth ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, New York, NY, USA. ACM, pp. 207–216 (1995)
Cilk Arts Inc.: Cilk++ programmer’s guide (2009)
Boehm, M.: KDE 4.0 API reference—introduction to ThreadWeaver. http://api.kde.org/4.0-api/kdelibs-apidocs/threadweaver/html/index.html (2012)
Nokia Corporation.: QtConcurrent. http://doc.trolltech.com/4.4/qtconcurrent.html (2008)
Intel Corporation.: Reference for Intel threading building blocks (2010)
OpenMP Architecture Review Board.: OpenMP application program interface version 3.0 (2008)
Sun Microsystems Inc.: Java platform standard edition 6 API specification, December 2006
Bordet, S.: Foxtrot—easy API for JFC/Swing. http://foxtrot.sourceforge.net/ (2012)
Charles, P., Grothoff, C., Saraswat, V., Donawa, C., Kielstra, A., Ebcioglu, K., von Praun, C., Sarkar, V.: X10: an object-oriented approach to non-uniform cluster computing. In: OOPSLA ’05: Proceedings of the 20th Annual ACM SIGPLAN Conference on Object Oriented Programming, Systems, Languages, and Applications. New York, NY, USA. ACM Press, pp. 519–538 (2005)
Microsoft.: Task Parallel Library (TPL). http://msdn.microsoft.com/en-us/library/dd460717.aspx (2012)
Sutter, H.: Use threads correctly = isolation + asynchronous messages. Dr. Dobb’s Journal, March 2009
École Polytechnique Fédérale de Lausanne.: The Scala programming language. http://www.scala-lang.org/ (2012)
Typesafe Inc.: Akka. http://akka.io (2012)
Danaher, J.S., Lee, I.-T.A., Leiserson, C.E.: Programming with exceptions in JCilk. Sci. Comput. Program. 63(2), 147–171 (2006)
Cavé, V., Zhao, J., Shirako, J., Sarkar, V.: Habanero-Java: the new adventures of old X10. In: Proceedings of the 9th International Conference on Principles and Practice of Programming in Java, pp. 51–61 (2011)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Giacaman, N., Sinnen, O. Parallel Task for Parallelising Object-Oriented Desktop Applications. Int J Parallel Prog 41, 621–681 (2013). https://doi.org/10.1007/s10766-013-0238-9
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10766-013-0238-9