## Abstract

We present an on-line (run-time) algorithm that manages the granularity of parallel functional programs. The algorithm exploits useful parallelism when it exists, and ignores ineffective parallelism in programs that produce many small tasks. The idea is to balance the amount of local work with the cost of distributing the work. This is achieved by ensuring that for every parallel task spawned, an amount of work that equals the cost of the spawn is performed locally. We analyse several cases and compare the algorithm to the optimal execution. In most cases the algorithm competes well with the optimal algorithm, even though the optimal algorithm has information about the future evolution of the computation that is not available to the on-line algorithm. This is quite remarkable considering we have chosen extreme cases that have contradicting optimal executions. Moreover, we show that no other on-line algorithm can be consistently better than it. We also present experimental results that demonstrate the effectiveness of the algorithm.

Original language | English |
---|---|

Pages (from-to) | 387-405 |

Number of pages | 19 |

Journal | Journal of Functional Programming |

Volume | 2 |

Issue number | 4 |

DOIs | |

State | Published - Oct 1992 |

### Bibliographical note

Funding Information:1 This research was supported in part by the Basic Research Foundation administered by the Israel Academy of Science and Humanities. 2 Current address: IBM TJ Watson Research Center, Yorktown Heights, NY, 10598, USA.