diff options
| author | Russ Cox <rsc@golang.org> | 2008-11-25 16:48:10 -0800 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2008-11-25 16:48:10 -0800 |
| commit | efc86a74e4e1f0bf38e42271dae11d7a23026b4d (patch) | |
| tree | 743804e70a46a7102c893ee7aa4e1684b477f272 /src/lib/net | |
| parent | 7cfa7eebf31126d7614281290d484874ad63413a (diff) | |
| download | go-efc86a74e4e1f0bf38e42271dae11d7a23026b4d.tar.xz | |
change meaning of $GOMAXPROCS to number of cpus to use,
not number of threads. can still starve all the other threads,
but only by looping, not by waiting in a system call.
fix darwin syscall.Syscall6 bug.
fix chanclient bug.
delete $GOMAXPROCS from network tests.
add stripped down printf, sys.printhex to runtime.
R=r
DELTA=355 (217 added, 36 deleted, 102 changed)
OCL=20017
CL=20019
Diffstat (limited to 'src/lib/net')
| -rw-r--r-- | src/lib/net/fd.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/net/fd.go b/src/lib/net/fd.go index 977df37a49..f9fba2bc0f 100644 --- a/src/lib/net/fd.go +++ b/src/lib/net/fd.go @@ -248,9 +248,11 @@ func (fd *FD) Write(p *[]byte) (n int, err *os.Error) { if fd == nil || fd.osfd == nil { return -1, os.EINVAL } + // TODO(rsc): Lock fd while writing to avoid interlacing writes. err = nil; nn := 0; for nn < len(p) && err == nil { + // TODO(rsc): If os.FD.Write loops, have to use syscall instead. n, err = fd.osfd.Write(p[nn:len(p)]); for err == os.EAGAIN { pollserver.WaitWrite(fd); |
