Hello,
I am trying to run my code repeatedly in a loop about 50 times for timing measurement. I have C code running on ubuntu 8 on a single processor, Intel x86. My code is something like this
Code:
for (loop =0;loop<=50;loop++)
{
// other operations
pDir = opendir("/proc");
while (pDir == NULL)
{
usleep(10);
pDir = opendir("/proc");
}
// some computations
closedir(pDir);
// other operations
} // end of loop
After about 28-29 times the loop stops executing. I initially had a return -1 if I got pDir == NULL. That caused my program to exit, and I dont want that. Any clues on why this happens, and how I can circumvent this?
Thanks for looking into this.