Thanks for the threading idea. Right now I am comfortable with classes. I also find the concept of "template" manageable. Keywords like "inline" etc. is where it becomes a bit difficult for me.

I have said this to give a general idea as to where I stand in C++. So can anyone recommend a good link to start reading about the concept of "threads"?

Regards.

P.S.: The SCANRAD usually lies between 20~70. Varies with the test case. I thought about ways to come up with different ways not to call the function, but I failed. Unfortunately, posting any more of my code would be a direct violation of my team guidelines.