Skip to content

Commit 9195948

Browse files
committed
os: document File's concurrent operation resource limits
Document that *os.File is subject to resource limits for concurrent operations. We aren't documenting a specific number of concurrent operations because that number is OS/system dependent. This limit comes from: internal/poll/fd_mutex.go where we use 20 bits to count locks. Fixes #32544 Change-Id: I7d305d4aaba5b2dbc6f1ab8c447117fde5e31a66 Reviewed-on: https://go-review.googlesource.com/c/go/+/181841 Reviewed-by: Rob Pike <[email protected]>
1 parent 68e2899 commit 9195948

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/os/file.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
// }
3535
// fmt.Printf("read %d bytes: %q\n", count, data[:count])
3636
//
37+
// Note: The maximum number of concurrent operations on a File may be limited by
38+
// the OS or the system. The number should be high, but exceeding it may degrade
39+
// performance or cause other issues.
40+
//
3741
package os
3842

3943
import (

0 commit comments

Comments
 (0)