Resource-Passing Concurrent Programming

  • Authors:
  • Kazunori Ueda

  • Affiliations:
  • -

  • Venue:
  • TACS '01 Proceedings of the 4th International Symposium on Theoretical Aspects of Computer Software
  • Year:
  • 2001

Quantified Score

Hi-index 0.00

Visualization

Abstract

The use of types to deal with access capabilities of program entities is becoming increasingly popular.In concurrent logic programming, the first attempt was made in Moded Flat GHC in 1990, which gave polarity structures (modes) to every variable occurrence and every predicate argument. Strong moding turned out to play fundamental r么les in programming, implementation and the in-depthunderstanding of constraint-based concurrent computation. The moding principle guarantees that each variable is written only once and encourages capability-conscious programming. Furthermore, it gives less generic modes to programs that discard or duplicate data, thus providing the view of "data as resources." A simple linearity system built upon the mode system distinguishes variables read only once from those read possibly many times, enabling compile-time garbage collection. Compared to linear types studied in other programming paradigms, the primary issue in constraint-based concurrency has been to deal with logical variables and highly non-strict data structures they induce.In this paper, we put our resource-consciousness one step forward and consider a class of 'ecological' programs which recycle or return all the resources given to them while allowing concurrent reading of data structures via controlled aliasing. This completely recyclic subset enforces us to think more about resources, but the resulting programs enjoy high symmetry which we believe has more than aesthetic implications to our programming practice in general.The type system supporting recyclic concurrent programming gives a [-1, +1] capability to eacho ccurrence of variable and function symbols (constructors), where positive/negative values mean read/write capabilities, respectively, and fractions mean non-exclusive read/write paths. The capabilities are intended to be statically checked or reconstructed so that one can tell the polarity and exclusiveness of each piece of information handled by concurrent processes. The capability type system refines and integrates the mode system and the linearity system for Moded Flat GHC. Its arithmetic formulation contributes to the simplicity.The execution of a recyclic program proceeds so that every variable has zero-sum capability and the resources (i.e., constructors weighted by their capabilities) a process absorbs match the resources it emits. Constructors accessed by a process withan exclusive read capability can be reused for other purposes.The first half of this paper is devoted to a tutorial introduction to constraint-based concurrency in the hope that it will encourage crossfertilization of different concurrency formalisms.