c - How many threads in a loop -


if create loop

for(int i=0;i<n;i++){//do something} 

and run through visual studio, program create thread every iteration, whole loop, or it's variable number?

and run through visual studio, program create thread every iteration, whole loop, or it's variable number?

none of above. program default have single thread of execution , execute each iteration of loop in series, without creating new ones.

only feature openmp (or similar) spawn different threads per iteration.

#include <omp.h>  #pragma omp parallel for(int n=0; n<10; ++n) { printf(" %d", n); } printf(".\n"); 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -