.NET Parallelism

| コメント(0) | トラックバック(0)

.NET Framework で並列化プログラミングを行う、Task Parallel Library (TPL) が姿を現したようです。MSDN Magazine October 2007 に興味深い話が出ています。タイトルは「マルチコア コンピュータ用にマネージ コードを最適化する」です。まだ、CTP は出ていませんが興味をそそられるものです。構文等は前述のアーティクルに載っているので参考になると思います。TPL は 並列 LINQ (PLINQ) を含め、Parallel FX Library と呼ばれるようです。PLINQ はクエリの並列処理を意図したものでアーティクルは「マルチコア プロセッサでクエリを実行する」で読めます。

現在、利用できておもしろいのは F# 1.9.2.9 に搭載された非同期構文です。現在はプレリリースのものが搭載され、Don Syme's WebLog on F# and Other Research Projects でも

asynchronous workflows are not primarily about parallelization of synchronous computations (they can be used for that, but you will probably want PLINQ and Futures).
となっているので注意が必要ですが。

これは、おもに時間のかかる I/O 処理の非同期実行を企図した構文で単純なサンプルは以下のように書けます。

module Cworld2000.Example
let task1 a b = async{ return a + b};;
let task2 a b = async{ return a * b};;
let Run = Async.Run (Async.Parallel [ task1 10 10; task2 10 20]);;

現在、これについてはコンパイラが出力したコードを調査中です。Iron Python で実行結果だけ調査すると。Int32[](20, 200) が返ってきているので結果は予想通りです。ただ、傾向だけ言うならば、並列化などの機能をインフラとして盛り込みつつあるのは確実な方向性です。少なくとも、そうしないとマルチコア時代に面倒なことになるのは明らかでしょう。

Foundations of F# (Expert's Voice in .Net) Foundations of F# (Expert's Voice in .Net)
Robert Pickering

Apress 2007-05-28
売り上げランキング : 14833

Amazonで詳しく見る
by G-Tools
Introduction to Parallel Computing: Design and Analysis of Algorithms Introduction to Parallel Computing: Design and Analysis of Algorithms
Anshul Gupta George Karpis Vipin Kumar

Addison-Wesley 2003-01-16
売り上げランキング : 114635

Amazonで詳しく見る
by G-Tools

トラックバック(0)

トラックバックURL: http://www.cworld2000.com/cgi-bin/mt/mt-tb.cgi/351

コメントする

Recent Tracks

gorn708's Profile Page

このブログ記事について

このページは、gornが2007年10月23日 15:14に書いたブログ記事です。

ひとつ前のブログ記事は「「文化審議会著作権分科会私的録音録画小委員会中間整理」に関する意見募集」です。

次のブログ記事は「今月中にVisual Studio 2008 が Release」です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。

Adwords