Documentation
¶
Index ¶
- Constants
- Variables
- type Loop
- func (q *Loop) BatchSyscall(cqes []uring.CQEntry, opts []SQOperation, ptrs ...uintptr) ([]uring.CQEntry, error)
- func (q *Loop) Close() (err0 error)
- func (q *Loop) RegisterBuffers(iovec []unix.Iovec) (err error)
- func (q *Loop) RegisterFiles(fds []int32) (err error)
- func (q *Loop) Syscall(opt SQOperation, ptrs ...uintptr) (uring.CQEntry, error)
- func (q *Loop) UnregisterBuffers() (err error)
- func (q *Loop) UnregisterFiles() (err error)
- func (q *Loop) UpdateFiles(fds []int32, off uint32) (err error)
- type Params
- type SQOperation
Constants ¶
const ( // WaitPoll monitors completion queue by polling (or IO_URING_ENTER with minComplete=0 in case of IOPOLL) WaitPoll uint = iota // WaitEnter monitors completion queue by waiting on IO_URING_ENTER with minComplete=1 // Registering files and buffers requires uring to become idle, with WaitEnter we are // blocking until the next event is completed. Even if queue is empty this // makes uring think that it is not idle. As a consequence Registering files // or buffers leads to deadlock. WaitEnter // WaitEventfd wathches eventfd of each queue in the shard. WaitEventfd )
const ( iota // FlagBatchSubmission enables feature to batch individual submission together // in one unix. If this flag is set SubmissionTimer option must be set as well. FlagBatchSubmission )FlagSharedWorkers = 1 <<
Variables ¶
var ( // ErrClosed returned if queue was closed. ErrClosed = errors.New("uring: closed") )
Functions ¶
This section is empty.
Types ¶
type Loop ¶
type Loop struct {
// contains filtered or unexported fields
}
Loop ...
func (*Loop) BatchSyscall ¶
func (q *Loop) BatchSyscall(cqes []uring.CQEntry, opts []SQOperation, ptrs ...uintptr) ([]uring.CQEntry, error)
BatchSyscall ...
func (*Loop) Close ¶
Close closes every shard queue, epoll instance and unregister eventfds. Close works as follows: - request close on each queue - once any queue exits - completionLoop will be terminated - once completion loop terminated - unregister eventfd's and close rings
func (*Loop) RegisterBuffers ¶
RegisterBuffers will register buffers on all rings (shards). Note that registration is done with unix, and will have to wait until rings are idle. TODO test if IORING_OP_PROVIDE_BUFFERS is supported (5.7?)
func (*Loop) RegisterFiles ¶
RegisterFiles ...
func (*Loop) Syscall ¶
Syscall executes operation on one of the internal queues. Additionaly it prevents ptrs from being moved to another location while Syscall is in progress. WARNING: don't use interface that hides this method. https://github.com/golang/go/issues/16035#issuecomment-231107512.
func (*Loop) UnregisterBuffers ¶
UnregisterBuffers ...