Skip to content
gqlxj1987's Blog
Go back

RingBuffer

Edit page

原repo

定义read pointer/write pointer部分

type RingBuffer struct {
	buf    []byte
	size   int
	r      int // next position to read
	w      int // next position to write
	isFull bool
	mu     sync.Mutex
}

read部分:

write部分:


Edit page
Share this post on:

Previous Post
Overlapping Experiment Infrastructure
Next Post
Naiad timely dataflow