Archive for category Internals
In the previous post we learned how Windows handles slow devices. Completion Port is an effective tool to handle I/O results. Completion Ports have Thread Pool like features, and it is not a coincident. Windows implements a Thread Pool, and it is partially based on Completion Ports. It may sound strange, because Thread Pool is […]
CPUs are incredibly fast, but sometimes they need to work with slow devices. How to handle these devices and let the CPU working efficiently?
I read a funny remark on ‘null’ comparison recently which at first glance seems to be surprising, but uppon further investigation becomes understandable. The following program demonstrates: The output of the program: False True How can the ‘Less than or equal’ operator be false, when it has the same value on both sides? And why […]
Not so long ago I’ve read a note in a blog comment. It said that experts above a certain level should write their for-loop as the following: The important part is the ++i. Why is this better? A vast majority of developers use i++, I haven’t any idea as to why. I use i++, too, […]
There are some misconceptions about Object.GetHashCode(). Two of them are quite prevalent: The implementation of Object.GetHashCode() derives the hash value from the reference (as a memory pointer value) of the instance The return value of Object.GetHashCode() is unique to the instance. No other instances will have the same hash value. These two claims may look […]