3 ms·
Windows does not allocate handles sequentially, and I've seen this pop up as a race condition and bug. I don't think changing the way they're assigned is necess
by asveikau 5y ago
Windows does not allocate handles sequentially, and I've seen this pop up as a race condition and bug. I don't think changing the way they're assigned is necessarily good enough.
- zvrba 5y ago> Windows does not allocate handles sequentially Indeed it does not, but it's not "random" either, i.e., they do get reused, probably rather quickly, so it does not solve the problem. Mark Russinovich or Raymond Chen (I think) had an article about why it's a bad idea to forcibly close files that are in use and they gave exactly that as a reason: the closed handle gets valid again, but for a different object, and, voila - corruption!