shm

package
v0.0.0-...-c7e0420 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockSize = 32
)
View Source
const IndicatorSize = 8 + kBufLength*ReadableInfoSize + 8*kBufLength
View Source
const ReadableInfoSize = 32
View Source
const StateSize = 32

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

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

func NewBlockFromShm

func NewBlockFromShm(buf []byte) (*Block, error)

func (*Block) MsgInfoSize

func (b *Block) MsgInfoSize() uint64

func (*Block) MsgSize

func (b *Block) MsgSize() uint64

func (*Block) ReleaseReadLock

func (b *Block) ReleaseReadLock()

func (*Block) ReleaseWriteLock

func (b *Block) ReleaseWriteLock()

func (*Block) SetMsgInfoSize

func (b *Block) SetMsgInfoSize(i uint64)

func (*Block) SetMsgSize

func (b *Block) SetMsgSize(i uint64)

func (*Block) TryLockForRead

func (b *Block) TryLockForRead() bool

func (*Block) TryLockForWrite

func (b *Block) TryLockForWrite() bool

type ConditionNotifier

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

func NewConditionNotifier

func NewConditionNotifier() *ConditionNotifier

func NewConditionNotifierE

func NewConditionNotifierE() (*ConditionNotifier, error)

func (*ConditionNotifier) Listen

func (n *ConditionNotifier) Listen(timeoutMs int, info *ReadableInfo) bool

func (*ConditionNotifier) Notify

func (n *ConditionNotifier) Notify(info *ReadableInfo) bool

func (*ConditionNotifier) Shutdown

func (n *ConditionNotifier) Shutdown()

func (*ConditionNotifier) Type

func (n *ConditionNotifier) Type() string

type Indicator

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

type MulticastNotifier

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

func NewMulticastNotifier

func NewMulticastNotifier() *MulticastNotifier

func NewMulticastNotifierE

func NewMulticastNotifierE() (*MulticastNotifier, error)

func (*MulticastNotifier) Listen

func (n *MulticastNotifier) Listen(timeoutMs int, info *ReadableInfo) bool

func (*MulticastNotifier) Notify

func (n *MulticastNotifier) Notify(info *ReadableInfo) bool

func (*MulticastNotifier) Shutdown

func (n *MulticastNotifier) Shutdown()

func (*MulticastNotifier) Type

func (n *MulticastNotifier) Type() string

type Notifier

type Notifier interface {
	Shutdown()
	Notify(info *ReadableInfo) bool
	Listen(timeoutMs int, info *ReadableInfo) bool
	Type() string
}
var ConditionNotifierInstance Notifier = NewConditionNotifier()
var MulticastNotifierInstance Notifier = NewMulticastNotifier()

func NewNotifier

func NewNotifier() Notifier

type ReadableBlock

type ReadableBlock WritableBlock

type ReadableInfo

type ReadableInfo struct {
	HostID     uint64
	BlockIndex uint32
	ChannelID  uint64
	// contains filtered or unexported fields
}

func (*ReadableInfo) Deserialize

func (r *ReadableInfo) Deserialize(b []byte) bool

func (*ReadableInfo) Serialize

func (r *ReadableInfo) Serialize() []byte

type Segment

type Segment interface {
	AcquireBlockToWrite(msgSize uint64, writableBlock *WritableBlock) bool
	ReleaseWrittenBlock(writableBlock *WritableBlock)
	AcquireBlockToRead(readableBlock *ReadableBlock) bool
	ReleaseReadBlock(readableBlock *ReadableBlock)
	Destroy() bool
	Reset()
	Remove() bool
	OpenOnly() bool
	OpenOrCreate() bool
	Type() string
}

func NewSegment

func NewSegment(channelID uint64) Segment

type ShmConf

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

func NewShmConf

func NewShmConf() *ShmConf

func NewShmConfByRealMsgSize

func NewShmConfByRealMsgSize(realMsgSize uint64) *ShmConf

func (*ShmConf) BlockBuffSize

func (c *ShmConf) BlockBuffSize() uint64

func (*ShmConf) BlockNum

func (c *ShmConf) BlockNum() uint32

func (*ShmConf) CeilingMsgSize

func (c *ShmConf) CeilingMsgSize() uint64

func (*ShmConf) ManagedShmSize

func (c *ShmConf) ManagedShmSize() uint64

func (*ShmConf) Update

func (c *ShmConf) Update(realMsgSize uint64)

type State

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

func NewStateFromShm

func NewStateFromShm(buf []byte) (*State, error)

func (*State) CeilingMsgSize

func (s *State) CeilingMsgSize() uint64

func (*State) DecreaseReferenceCounts

func (s *State) DecreaseReferenceCounts()

func (*State) FetchAddSeq

func (s *State) FetchAddSeq(diff uint32) uint32

func (*State) IncreaseReferenceCounts

func (s *State) IncreaseReferenceCounts()

func (*State) NeedRemap

func (s *State) NeedRemap() bool

func (*State) ReferenceCounts

func (s *State) ReferenceCounts() uint32

func (*State) Seq

func (s *State) Seq() uint32

func (*State) SetNeedRemap

func (s *State) SetNeedRemap(need bool)

type WritableBlock

type WritableBlock struct {
	Index uint32
	Block *Block
	Buf   []byte
}

type XSISegment

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

func NewXSISegment

func NewXSISegment(channelID uint64) *XSISegment

func (*XSISegment) AcquireBlockToRead

func (s *XSISegment) AcquireBlockToRead(readableBlock *ReadableBlock) bool

func (*XSISegment) AcquireBlockToWrite

func (s *XSISegment) AcquireBlockToWrite(msgSize uint64, writableBlock *WritableBlock) bool

func (*XSISegment) Destroy

func (s *XSISegment) Destroy() bool

func (*XSISegment) OpenOnly

func (s *XSISegment) OpenOnly() bool

func (*XSISegment) OpenOrCreate

func (s *XSISegment) OpenOrCreate() bool

func (*XSISegment) ReleaseReadBlock

func (s *XSISegment) ReleaseReadBlock(readableBlock *ReadableBlock)

func (*XSISegment) ReleaseWrittenBlock

func (s *XSISegment) ReleaseWrittenBlock(writableBlock *WritableBlock)

func (*XSISegment) Remove

func (s *XSISegment) Remove() bool

func (*XSISegment) Reset

func (s *XSISegment) Reset()

func (*XSISegment) Type

func (s *XSISegment) Type() string

Jump to

Keyboard shortcuts

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