Documentation
¶
Overview ¶
Package fdmap maps OS descriptors to connection objects using the cheapest synchronization available on each platform.
Index ¶
Constants ¶
const UseSingleInstance = true
Unix fds are small integers, so all event loops can share one direct index.
Variables ¶
var ErrOutOfRange = errors.New("fdmap: descriptor out of range")
var MaxOpenFiles = maxOpenFilesCeiling
MaxOpenFiles covers the conventional Unix per-process fd ceiling. It is reduced to the process soft limit during initialization when necessary.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map[V any] struct { // contains filtered or unexported fields }
Map is an atomic direct-index table shared by Unix event loops. Deletion must be published before a descriptor is closed because the kernel may reuse its integer immediately.
func NewMap ¶
NewMap returns an empty descriptor table; segments allocate with the descriptors published into them.
func (*Map[V]) DeleteValue ¶ added in v1.6.0
DeleteValue removes k only while it still maps to v, so a holder that lost the slot to another value leaves that value in place.