In this article:
http://msdn.microsoft.com/en-us/magazine/jj883956.aspx
The author declares that the following code may fail due to “loopback reading”:
class Test
{
private bool _flag = true;
public void Run()
{
// Set _flag to false on another thread
new Thread(() => { _flag = false; }).Start();
// Poll the _flag field until it is set to false
while (_flag) ;
// The loop might never terminate!
}
}
In loop raise mode, the compiler can change the while loop above to the following due to a single-threaded assumption:
if (_flag) { while (true); }
, : , , - _flag , ? , " # ", , , , ECMA, ARM . , , .
:
# ?
, , , , ...