In reply to dave_59:
Hi Dave,
Thanks. I think I kind of got your point. I kind of mixed two diff things and, got confused. Sorry for my confusion. My confusion was actually if the methods inside the class have an “Automatic lifetime”. Then for each of these threads the variables eq_pa and, i are also Automatic by default. But that does not make any sense since within a given instance there will be only 1 copy of these global variables which will get shared across all the threads.
So it is just that only the methods are Automatic by default in a class context like (For example this function: hiarb_hifis_req() in this case) and, we have multiple stack entries allocated for them for each call but, the variables (eq_pa and i) are shared by all threads and, we need to make it Automatic variable in this case to avoid this race condition. Also I believe the lifetime of this Automatic variable is very short and should disappear when leaving a scope. I think it may be active only till the procedural end of that scope (After that particular forked process thread ends).
Please kindly correct me if my understanding is incorrect here . Thanks Dave :)