mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00:00
syntax highlighting
parent
91ad92a059
commit
ad56cb2db2
@ -1,8 +1,8 @@
|
|||||||
# Bounding resource use
|
# Bounding resource use
|
||||||
|
|
||||||
To bound a program's use of a limited resource, like memory, have goroutines synchronize their use of that resource using a buffered channel (i.e., use the channel as a semaphore):
|
To bound a program's use of a limited resource - like memory - have goroutines synchronize their use of that resource using a buffered channel (i.e., use the channel as a semaphore):
|
||||||
|
|
||||||
```
|
```go
|
||||||
const (
|
const (
|
||||||
AvailableMemory = 10 << 20 // 10 MB
|
AvailableMemory = 10 << 20 // 10 MB
|
||||||
AverageMemoryPerRequest = 10 << 10 // 10 KB
|
AverageMemoryPerRequest = 10 << 10 // 10 KB
|
||||||
|
Loading…
x
Reference in New Issue
Block a user