Groovy and Concurrency with GPars

This talk looks at using Groovy for writing multi-threaded, concurrent and parallel programs. We'll briefly look at leveraging legacy Java techniques such as multiple processes, multiple threads, the java.util.concurrent APIs and shared-state atomicity.

We'll then look as some useful AST transforms in core Groovy (Lazy, Synchronized, Immutable, WithReadLock and WithWriteLock) before divign headlong into GPars. GPars is a comprehensive library for parallel execution that provides a menu of options to the developer.

The different choices available have pros and cons depending on the circumstances. We'll look at the parallel collection support and the optional transparent way to use that support. Then we'll examine Map/Reduce. We'll also look at the DataFlow approach to achieving concurrency, the Actors approach, the use of composable asynchronous functions and the use of Agents and Active Objects.

Finally, we'll peek at Multiverse (Software Transactional Memory) and JCSP, two emerging approaches that might appear more prominently in future versions of GPars. Then we'll wrap up with a brief look at testing multi-threaded programs.


About Paul King

Paul King

Paul King leads ASERT, an organization based in Brisbane, Australia which provides software development, training and mentoring services to customers wanting to embrace new technologies, harness best practices and innovate. He has been contributing to open source projects for nearly 20 years and is an active committer on numerous projects including Groovy. Paul speaks at international conferences, publishes in software magazines and journals, and is a co-author of Manning's best-seller: Groovy in Action.

More About Paul »