Originally Posted by
Salem
So if you write
Code:
printf("About to invoke thread\n");
ret = invoke_thread_S();
do you see all the output of the loop before the message "About to invoke thread"?
Let us say , and there is 2 values that fulfil the condition
Code:
(c % Messages[k][2] ) == 0
, then in a particular run this is what happened:
Code:
1st_val, act, c
execution of thread S
2nd_val, act, c
About to invoke thread
So, the issue is as follows: a particular execution "i" of thread S acts upon the updates values as done in the following
Code:
db_Lock();
update_status( Messages[k][0], 1);
db_UnLock();
So, in the aforementioned example, 2nd_val could not be updated and hence execution "i" of thread S will not consider this value. Only its "i+1" execution.
thanks,