Starting in go1.9, Golang lowers the timer frequency when not required
reducing CPU usage. This workaround prevents Golang from doing so,
and since the initial issue was fixed, I see no perf regressions.
This does not need to be conditional based on Golang verison, as the issue
being worked around was only in go1.6.
Signed-off-by: Darren Stahl <darst@microsoft.com>
The Go race detector doesn't like concurrent access to bool. This change
moves the bool to use atomicBool, and extends atomicBool with the swap()
method, to handle conditional use.
This prevent a deadlock if `prepareIo()` is called on a closing file as
`Done()` would never been called afterwards.
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
In order to upgrade to go1.8 all IO operations
including previous pending IO must have the deadline
set when SetReadDeadline or SetWriteDeadline is called
Signed-off-by: Darren Stahl <darst@microsoft.com>
This forces any pending data to be sent to the remote party before
emitting the 0-length EOF message, to make sure it appears as a seperate
message.
This fixes the "TestEchoWithMessaging" test
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
This includes Reader, Writer, and Closer interfaces on top of
Windows file handles in a way that does not block the system thread
while the IO is outstanding.
This also includes net.Listener and net.Conn for named pipes.