pools

package
v0.0.0-...-1c16a6c Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayPool

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

数组池的想法违背了go的思想:Don't communicate by sharing memory; share memory by communicating. 而且通过share memory很难沟通,除非goroutine一直运行; 还是用chan沟通比较简单 而且通过share memory很难通过单一的变量控制状态 性能也并不会很好

func New

func New(arr *[]int) *ArrayPool

func (*ArrayPool) Add

func (p *ArrayPool) Add(i int) bool

func (*ArrayPool) Get

func (p *ArrayPool) Get() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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