The code used to detect if a program was running on Windows by launching
a powershell script (which requires powershell to be installed), writing
the output to a file with a fixed name (which requires write permissions
in the local directory), and then reading the file (which may have
changed), and then deleting it (which may fail and introduces a race
with any other program running in the same directory).
This version reads a key from the Windows registry. That could fail if
the application does not have permissions to read the registry, but at
least does not crash when it does, and it is not inheritently racy.
TCP_INQ is a socket option we added to Linux to report pending bytes
on the socket as a control message.
Using TCP_INQ we can accurately decide whether to continue read or not.
Add an urgent parameter, when we do not want to wait for EPOLLIN.
This commit improves the latency of 1 RPC unary (minimal benchmark)
significantly:
Before:
l_50: 61.3584984733
l_90: 94.8328711277
l_99: 126.211351174
l_999: 158.722406029
After:
l_50: 51.3546011488 (-16%)
l_90: 72.3420731581 (-23%)
l_99: 103.280218974 (-18%)
l_999: 130.905689996 (-17%)
grpc_handshake is renamed to GrpcHandshake, using C++ class definitions
instead of C-style vtable classes. Update callers to use new interfaces.
We use RefCountedPtr to simplify reference tracking.
This is to use `grpc_core::RefCount` to improve performnace.
This commit also replaces explicit C vtables, with C++ vtable
with its own compile time assertions and performance benefits.
It also makes use of `RefCountedPtr` wherever possible.