Documentation: Parallel Template Library (PTL)

Introduction

Current versions of Parallel Template Library (PTL) are very similar generic and parallel software libraries for .NET, Java and Android developers.

PTL provides containers, iterators, algorithms and function objects (functors) with the following design principles:

  • Algorithms manipulate data but are not aware of containers.
  • Containers store data but are not aware of algorithms.
  • Algorithms and containers interact through iterators.
  • Function objects (functors) are the main method of policy parameterization.

Algorithms are totally decoupled from containers. Adding an algorithm doesn't require you to rewrite any containers.

Some of the common aspects of using PTL are:

  • It is parallel. Many components take advantage of multi/many core hardware and scale linearly with the number of cores.
  • It is extensible and designed to interoperate with your custom components. Using it effectively means extending it.
  • It is customizable without inheritance. New iterators need only to satisfy an abstract set of requirements.
  • Abstraction does not mean inefficiency. Generic algorithms are as efficient as if they had been written for one specific data type.

Abstract requirements enforced through a precise set of interfaces are central to PTL. The generic components provide a new way to think about programming; they achieve abstraction without loss of efficiency.

Defining new abstract concepts and writing components in terms of them is the essence of generic programming.