concurrents

package
v0.0.0-...-8d6ba69 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CausalMemory

type CausalMemory struct {
	SharedMemory

	LocalMem []interface{}
	// contains filtered or unexported fields
}

func (*CausalMemory) Broadcast

func (c *CausalMemory) Broadcast(msg *CausalMsg)

func (*CausalMemory) Init

func (c *CausalMemory) Init(pID int, size int, memberN int) bool

Init initialize the local memory with process id, size of memory, and the number of nodes.

func (*CausalMemory) Read

func (c *CausalMemory) Read(key int) interface{}

Read local read.

func (*CausalMemory) Stopped

func (c *CausalMemory) Stopped() bool

Stopped testify if the memory is stopped.

func (*CausalMemory) Write

func (c *CausalMemory) Write(key int, value interface{})

Write local write.

type CausalMsg

type CausalMsg struct {
	SourceID int
	Key      int
	Value    interface{}
	Ts       TimeStamp
}

type Queue

type Queue []*CausalMsg

func (*Queue) Len

func (h *Queue) Len() int

func (*Queue) Less

func (h *Queue) Less(i, j int) bool

func (*Queue) Pop

func (h *Queue) Pop() interface{}

func (*Queue) Pop_Queue

func (h *Queue) Pop_Queue() interface{}

func (*Queue) Push

func (h *Queue) Push(x interface{})

func (*Queue) Swap

func (h *Queue) Swap(i, j int)

type SharedMemory

type SharedMemory interface {
	Init(size int, memberN int) bool
	Read(key int) (interface{}, bool)
	Write(key int, value interface{}) bool
	GetMap() (*[]interface{}, bool)
}

type TimeStamp

type TimeStamp []int

Jump to

Keyboard shortcuts

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