Futures and promisesとは? わかりやすく解説

Weblio 辞書 > 辞書・百科事典 > 百科事典 > Futures and promisesの意味・解説 

Future パターン

(Futures and promises から転送)

出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2024/08/14 11:48 UTC 版)

future, promise, delay とは、プログラミング言語における並列処理デザインパターン。何らかの処理を別のスレッドで処理させる際、その処理結果の取得を必要になるところまで後回しにする手法。処理をパイプライン化させる。1977年に考案され、現在ではほとんどのプログラミング言語で利用可能。

概要

カール・ヒューイットは、2つの点で future の方が promise よりも適した用語であるとしている。第一に promise(約束)は必ずしも将来の時点のことを意味しないため、future(未来)よりも曖昧である。第二に promise は単なる言語表現だが、future は現物(actuals)に対する先物(futures)という意味もある(つまり、実際の物に対する代用品)。

future という構文が最初に紹介されたのは1977年ヘンリー・ベイカー英語版カール・ヒューイットの論文でのことであった。一方 promise という用語は、1976年にダニエル・P・フリードマン英語版とデビッド・ワイズが提案し、最終的にピーター・ヒバードが呼んだものである。future (promise) の使用により、分散システムにおける遅延を劇的に減少させることができる。例えばアクターモデルのようにメッセージのパイプライン化が可能であり、これをE言語英語版Alice ML英語版では promise pipelining と呼ぶ[1]

パイプライン化

一般的なRPCで次のような式を考える。

t3 := (x.a()).c(y.b())

これは、次のように展開できる。

t1 := x.a(); t2 := y.b(); t3 := t1.c(t2)

これを解釈すると、t1 および t2 の値が定まらないと t3 の値は計算できない。future を使うとこの式が次のように表される。

t3 := future (future x.a()).c(future y.b())

これを展開すると次のようになる。

t1 := future x.a(); t2 := future y.b(); t3 := future t1.c(t2)

このようにすると t3 は即座に計算される。ただし、t3 から情報を得ようとすると待たされる。

実装

future構文は MultiLisp や Act1 といったプログラミング言語で実装された。並行論理プログラミング言語における論理変数もよく似ている。これは当初 Prolog with Freeze や IC Prolog で使われ、Relational Language、Concurrent PrologPARLOGGHCKL1Strand、Vulcan、Janus、Mozart/Oz、Flow Java、Alice といった言語で真の並行性プリミティブとなった。Concurrent ML のような単一代入規則型データフロー言語の I-var は並行論理変数とよく似ている。

future による遅延最小化のようなパイプライン化技法はまずアクターモデルで生み出され、1988年にバーバラ・リスコフが再発明し、1989年ごろにはザナドゥ計画でも再発明されている。

future, promise, 並行論理変数, データフロー変数, I-var をサポートする言語:

加えて、promise pipelining をサポートする言語:

非標準ライブラリによる実装:

参考文献

  • Henry Baker and Carl Hewitt The Incremental Garbage Collection of Processes Proceeding of the Symposium on Artificial Intelligence Programming Languages. SIGPLAN Notices 12, August 1977.
  • Henry Lieberman. Thinking About Lots of Things at Once without Getting Confused: Parallelism in Act 1 MIT AI memo 626. May 1981.
  • Henry Lieberman. A Preview of Act 1 MIT AI memo 625. June 1981.

脚注

  1. ^ Kenjiro Taura, Satoshi Matsuoka, and Akinori Yonezawa (1994). "ABCL/f: A Future-Based Polymorphic Typed Concurrent Object-Oriented Language -- Its Design and Implementation.". In Proceedings of the DIMACS workshop on Specification of Parallel Algorithms, number 18 in Dimacs Series in Discrete Mathematics and Theoretical Computer Science. American Mathematical Society. pp. 275–292.
  2. ^ Future class - dart:async library - Dart API”. 2021年6月17日閲覧。
  3. ^ Completer class - dart:async library - Dart API”. 2021年6月17日閲覧。
  4. ^ Asynchronous programming: futures, async, await”. 2021年6月17日閲覧。
  5. ^ Steve Dekorte (2006, 2007, 2008). “Io, The Programming Language”. 2008年5月5日閲覧。
  6. ^ Rich Hickey (2009年). “changes.txt at 1.1.x from richhickey's clojure”. 2013年4月14日閲覧。
  7. ^ Seif Haridi; Nils Franzen. “Tutorial of Oz”. MOzart Global User Library. 12 April 2011閲覧。
  8. ^ Parallelism with Futures”. PLT. 02 March 2012閲覧。
  9. ^ asyncfutures”. nim-lang.org. 2021年6月12日閲覧。
  10. ^ Boost.Future
  11. ^ Boost.Promise
  12. ^ Task Parallelism (Concurrency Runtime) | Microsoft Docs

関連項目

外部リンク


「Futures and promises」の例文・使い方・用例・文例

Weblio日本語例文用例辞書はプログラムで機械的に例文を生成しているため、不適切な項目が含まれていることもあります。ご了承くださいませ。


英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

Futures and promisesのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Futures and promisesのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
ウィキペディアウィキペディア
All text is available under the terms of the GNU Free Documentation License.
この記事は、ウィキペディアのFuture パターン (改訂履歴)の記事を複製、再配布したものにあたり、GNU Free Documentation Licenseというライセンスの下で提供されています。 Weblio辞書に掲載されているウィキペディアの記事も、全てGNU Free Documentation Licenseの元に提供されております。
Tanaka Corpusのコンテンツは、特に明示されている場合を除いて、次のライセンスに従います:
 Creative Commons Attribution (CC-BY) 2.0 France.
この対訳データはCreative Commons Attribution 3.0 Unportedでライセンスされています。
浜島書店 Catch a Wave
Copyright © 1995-2025 Hamajima Shoten, Publishers. All rights reserved.
株式会社ベネッセコーポレーション株式会社ベネッセコーポレーション
Copyright © Benesse Holdings, Inc. All rights reserved.
研究社研究社
Copyright (c) 1995-2025 Kenkyusha Co., Ltd. All rights reserved.
日本語WordNet日本語WordNet
日本語ワードネット1.1版 (C) 情報通信研究機構, 2009-2010 License All rights reserved.
WordNet 3.0 Copyright 2006 by Princeton University. All rights reserved. License
日外アソシエーツ株式会社日外アソシエーツ株式会社
Copyright (C) 1994- Nichigai Associates, Inc., All rights reserved.
「斎藤和英大辞典」斎藤秀三郎著、日外アソシエーツ辞書編集部編
EDRDGEDRDG
This page uses the JMdict dictionary files. These files are the property of the Electronic Dictionary Research and Development Group, and are used in conformance with the Group's licence.

©2025 GRAS Group, Inc.RSS