I want to implement the cpu_relax() function in order to use it
    inside loops. However before, I would like to know if the fpc
    compiler is doing an optimization of this kind.

I don't think one would you use that "inside a loop" or "to improve branching" but rather inside a wait-loop where constant polling, without regular pausing, keeps the processor unnecessarily busy. The operating system has calls for that purpose (e.g. usleep, see <https://linux.die.net/man/3/usleep>). That is not up to the compiler.

Regards,

Adriaan van Os

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to