;;; -*- mode: scheme; coding: utf-8; -*- ;;; ;;; Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc. ;;; ;;; This library is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU Lesser General Public ;;; License as published by the Free Software Foundation; either ;;; version 3 of the License, or (at your option) any later version. ;;; ;;; This library is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;; Lesser General Public License for more details. ;;; ;;; You should have received a copy of the GNU Lesser General Public ;;; License along with this library; if not, write to the Free Software ;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA (define-module (ice-9 futures) #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) #:use-module (srfi srfi-9 gnu) #:use-module (srfi srfi-11) #:use-module (ice-9 q) #:use-module (ice-9 match) #:use-module (ice-9 control) #:use-module (ice-9 threads) #:export (future make-future future? touch)) ;;; Author: Ludovic Courtès ;;; ;;; Commentary: ;;; ;;; This module provides an implementation of futures, a mechanism for ;;; fine-grain parallelism. Futures were first described by Henry Baker ;;; in ``The Incremental Garbage Collection of Processes'', 1977, and ;;; then implemented in MultiLisp (an implicit variant thereof, i.e., ;;; without `touch'.) ;;; ;;; This modules uses a fixed thread pool, normally one per CPU core. ;;; Futures are off-loaded to these threads, when they are idle. ;;; ;;; Code: