私のプロジェクトの一部として、スレッドを使用して数値積分アルゴリズムを変更する必要があります。
これは、従来のシーケンシャル アプローチで大まかに起こることです。
void Controller(struct DE)
{
//initialization step
for(;;) //till the entire range has not been covered...
{
//compute the next time-point solution using the previously known solutions.
NIiter();
//then check if the result is acceptable or not and take the necessary steps...
}
}
今、これが私がやろうとしていることです....
void Controller(struct DE)
{
//initialization step
for(;;) //till the entire range has been covered...
{
//compute the next time using the previously known solution.
NIiter();
//when I have an approximate solution available..launch a thread to compute the next time-point using this approximate solution as a previous solution...something like forward pipelining...
//then check if BOTH the results are acceptable or not and take the necessary steps...
}
}
しかし、おおよその解決策が利用可能であることをコントローラーに通知する方法がわかりません...新しいスレッドを起動できます...
これは、マルチスレッド プログラミングへの私の最初の暴露です...だから、これが明白な質問のように思われる場合は、私を許してください..また、私は自分のプロジェクトで Pthread ライブラリを使用しています...