mirror of
https://github.com/golang/go
synced 2024-11-15 01:30:31 -07:00
adb384ad2c
This change is an experimental implementation of asynchronous cancelable I/O operations on Plan 9, which are required to implement deadlines. There are no asynchronous syscalls on Plan 9. I/O operations are performed with blocking pread and pwrite syscalls. Implementing deadlines in Go requires a way to interrupt I/O operations. It is possible to interrupt reads and writes on a TCP connection by forcing the closure of the TCP connection. This approach has been used successfully in CL 31390. However, we can't implement deadlines with this method, since we require to be able to reuse the connection after the timeout. On Plan 9, I/O operations are interrupted when the process receives a note. We can rely on this behavior to implement a more generic approach. When doing an I/O operation (read or write), we start the I/O in its own process, then wait for the result asynchronously. The process is able to handle the "hangup" note. When receiving the "hangup" note, the currently running I/O operation is canceled and the process returns. This way, deadlines can be implemented by sending an "hangup" note to the process running the blocking I/O operation, after the expiration of a timer. Fixes #11932. Fixes #17498. Change-Id: I414f72c7a9a4f9b8f9c09ed3b6c269f899d9b430 Reviewed-on: https://go-review.googlesource.com/31521 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> |
||
---|---|---|
.. | ||
archive | ||
bufio | ||
builtin | ||
bytes | ||
cmd | ||
compress | ||
container | ||
context | ||
crypto | ||
database/sql | ||
debug | ||
encoding | ||
errors | ||
expvar | ||
flag | ||
fmt | ||
go | ||
hash | ||
html | ||
image | ||
index/suffixarray | ||
internal | ||
io | ||
log | ||
math | ||
mime | ||
net | ||
os | ||
path | ||
plugin | ||
reflect | ||
regexp | ||
runtime | ||
sort | ||
strconv | ||
strings | ||
sync | ||
syscall | ||
testing | ||
text | ||
time | ||
unicode | ||
unsafe | ||
vendor/golang_org/x | ||
all.bash | ||
all.bat | ||
all.rc | ||
androidtest.bash | ||
bootstrap.bash | ||
buildall.bash | ||
clean.bash | ||
clean.bat | ||
clean.rc | ||
cmp.bash | ||
iostest.bash | ||
make.bash | ||
make.bat | ||
Make.dist | ||
make.rc | ||
naclmake.bash | ||
nacltest.bash | ||
race.bash | ||
race.bat | ||
run.bash | ||
run.bat | ||
run.rc |