Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Clarifying the exception specification for bulk callback functions

オープン
#2,129 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
静か
技術スタック
cpp

調査の方向性

include/stdexec/__detail/__parallel_scheduler.hpp の390-419行目を読み、parallel schedulerのcallback処理をデフォルトのbulk実装と比較してください。提供されているsync_wait/bulkの例を使って、std::runtime_errorがreceiverのset_errorと周囲のcatchに到達すべきかを確認してください。カスタマイズされたbulk実装の例外契約が決定され、検証されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Do we really allow the bulk callback function to throw an exception? That is, when the bulk callback throws an exception, will that exception be propagated through the receiver's set_error(std::exception_ptr)?
Consider:
Given a scheduler sch, what should be the behavior of the following code?

try {
    stdexec::sync_wait(stdexec::schedule(sch) | stdexec::bulk(std::execution::par, 1uz, [](std::size_t){
        throw std::runtime_error{"xxx"}; 
    }));
}
catch (const std::runtime_error& e) { 
    ...
}

Can the try-catch here catch this std::runtime_error?
For the default implementation of bulk, the answer is yes, it can be caught. But for some customized bulk implementations, it may be different. For example, if sch here is a stdexec::parallel_scheduler, the program will terminate, see https://github.com/NVIDIA/stdexec/blob/e8c349f3f3425b9341306bc56615fc5279a15cf4/include/stdexec/__detail/__parallel_scheduler.hpp#L390-L419
which does not handle the case where the call to __state->__fun_ throws an exception. However, fixing this seems a bit tricky, or should we reconsider the exception specification of bulk_item_receiver_proxy::execute?

主要言語
C++
スター
2.4k
フォーク
270
平均マージ
2日 16時間
マージ済み PR(30日)
43

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA/stdexec のほかの issue

NVIDIA/stdexec の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。