Commit Graph
17 Commits
Author SHA1 Message Date
Darren Stahl 6f4ae360a5 Remove workaround to perf issues in go1.6
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>
2018-01-09 14:51:38 -08:00
Darren Stahl 3d52dc4a97 Test bug: Fix server connections not closing in TestEchoWithMessaging
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-08-04 10:24:26 -07:00
Darren Stahl c57b87d6d4 Prevent adding to a sync.WaitGroup that has a waiter
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-08-03 15:26:45 -07:00
Tim Ebringer 73020a3110 Bool is not atomic
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.
2017-07-24 21:04:39 -04:00
Kenfe-Mickael Laventure 1ba55a6b1b Don't increment the wait count if the file is closing
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>
2017-07-19 18:15:28 +02:00
Darren Stahl a64f284add Move f.wg.Done() to Read and Write to avoid leaking handles
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-05-19 15:42:58 -07:00
Darren Stahl 899dbf3ba5 Apply read and write deadlines to pending IO
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>
2017-05-05 14:53:42 -07:00
Darren Stahl e9792bc98c Added runtime.KeepAlive for the new stricter 1.8 GC
Signed-off-by: Darren Stahl <darst@microsoft.com>
2017-05-03 12:47:12 -07:00
Simon Ferquel 7c7d6b461c Flush file buffers on CloseWrite
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>
2017-03-17 16:57:20 +01:00
Cezar Sa Espinola 94c0518b08 Include build tags to allow go get on non-Windows platforms. Fixes #30 2016-10-06 18:00:50 -03:00
Darren Stahl 4191cdca28 Fixed error in #12
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-03-15 15:51:39 -07:00
Darren Stahl 3e4c0f5aa3 Fixes performance regression in GO 1.6
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-03-15 15:25:25 -07:00
John Starks fe517a5118 Misc. cleanup
Signed-off-by: John Starks <jostarks@microsoft.com>
2016-01-31 14:18:04 -08:00
John Starks 99eef7be8d Ensure DialPipe times eventually by default
Signed-off-by: John Starks <jostarks@microsoft.com>
2016-01-31 14:00:21 -08:00
John Starks 3191792462 Fix errors to better match net package
Signed-off-by: John Starks <jostarks@microsoft.com>
2016-01-31 13:47:08 -08:00
John Starks b0d265e6c2 Ensure win32PipeListener.Close() correctly aborts Listen() calls
Signed-off-by: John Starks <jostarks@microsoft.com>
2016-01-31 13:46:55 -08:00
John Starks f001f808a9 Add file and pipe Windows wrappers
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.
2016-01-30 18:11:47 -08:00