Wednesday, September 1, 2010

barrier ... cont

1.we have statements

stmt1;
stmt2;
------marker
'mystmt'
stmt3;

here the programmer is of the assumption that by the time control reaches marker
the 2 statements are finished completely and stmt3 would be a new sequence of commands
we can safely put since our assumptions are right here
But we are seeing the code from a code space angle
the code internally is generated by compiler , that is not bound by any strict criteria
for optimization it can reorganize codes in different ways
ie some of the side effects of stmt1 and 2 would be executed after stmt3
this can create serious problem when critical mystmts are executed with assumptions

No comments:

Post a Comment