2014年4月3日 星期四

Data race condition


      A race condition is an undesirable situation that occurs when a device or system attempts to perform two or more operations at the same time, but because of the nature of the device or system, the operations must be done in the proper sequence in order to be done correctly.


      In computer memory or storage, a race condition may occur if commands to read and write a large amount of data are received at almost the same instant, and the machine attempts to overwrite some or all of the old data while that old data is still being read. The result may be one or more of the following: a computer crash, an "illegal operation," notification and shutdown of the program, errors reading the old data, or errors writing the new data. This can be prevented by serialization of memory or storage access, such that if read and write commands are received close together, the read command is executed and completed first, by default.

      In a network, a race condition may occur if two users attempt to access an available channel at the same instant, and neither computer receives notification that the channel is occupied before the system grants access. Statistically, this sort of coincidence is most likely to occur in networks having long lag times, such as those that use geostationary satellites. To prevent such a race condition from developing, a priority scheme must be devised. For example, the subscriber whose username begins with the earlier letter of the alphabet (or the lower numeral) may get priority by default when two subscribers attempt to access the system within a prescribed increment of time. Hackers can take advantage of race-condition vulnerabilities to gain unauthorized access to networks.

      Race conditions occasionally occur in logic gates when certain inputs come into conflict. Because the gate output state takes a finite, nonzero amount of time to react to any change in input states, sensitive circuits or devices following the gate may be fooled by the state of the output, and thereby caused to not operate properly


Data source from : http://searchstorage.techtarget.com/definition/race-condition

沒有留言:

張貼留言