ringbuffer

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RingBuffer

type RingBuffer struct {
	// contains filtered or unexported fields
}

为了获得高性能,使用伪共享填充在多线程环境下确保read和write不共享相同的缓存行

func New

func New(capacity uint64) *RingBuffer

func (*RingBuffer) Capacity

func (ring *RingBuffer) Capacity() uint64

Capacity 最大容量

func (*RingBuffer) Dequeue

func (ring *RingBuffer) Dequeue() any

func (*RingBuffer) Enqueue

func (ring *RingBuffer) Enqueue(value any) error

func (*RingBuffer) Size

func (ring *RingBuffer) Size() uint64

Size 实际大小

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL