"Fail safe" means: it won't fail.
"Fail fast" means: it may fail ... and the failure condition is checked aggressively so that the failure condition is detected before damage can be done.
"Fail fast" means: it may fail ... and the failure condition is checked aggressively so that the failure condition is detected before damage can be done.
The fail-fast iterators are typically implemented using a
volatile counter on the list object.- When the list is updated, the counter is incremented.
- When an
Iteratoris created, the current value of the counter is embedded in theIteratorobject. - When an
Iteratoroperation is performed, the method compares the two counter values and throws a CME if they are different.
No comments:
Post a Comment