The relationship between threads in C

As part of my project, I have to change the numerical integration algorithm using streams.

This is roughly what happens in the traditional sequential approach.

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...
    }
}

Now this is what I intend to do ....

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...
    }
}

But I don’t understand how to tell my controller that an approximate solution is available ... so it can start a new thread ...

This is my first introduction to multi-threaded programming ... so forgive me if this seems like an obvious question. I also use the Pthread library in my project ...

0
source share
1 answer

This is an extensive topic, but here are a few pointers

  • - .
  • IPC - , , .

.

+1

All Articles