Go io uring syscall implementation without CGO, rewrite on branch v0.4
Find a file
Nugraha 7eedf9754b
all: use of unsafe pointer for ring, and adjustments
There's other adjustment/addition:
 * Function name CQE/SQE renamed to Cqe/Sqe.
 * SQ entry union sets value withput util to reduce function
   complexity, so leaving function budget for another stuff.
 * UserData has its own type, implement for uint64, uintptr,
   and unsafe.
 * TODO: decide what to use `Syscall` or `RawSyscall`.
 * Exposed `SeenCqe`.
 * Ignore *.test file extension.
 * Inline cost tool.

Signed-off-by: Nugraha <richiisei@gmail.com>
2022-07-28 19:45:51 +07:00
assets doc: update graph 2022-07-07 23:30:52 +07:00
bench/perf bench/perf: use of go sched 2022-07-07 23:31:18 +07:00
.gitignore all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
go.mod all: initial files 2022-07-05 04:52:54 +07:00
go.sum all: initial files 2022-07-05 04:52:54 +07:00
hdr.go all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
hdr_int_flags.go all: initial files 2022-07-05 04:52:54 +07:00
hdr_struct.go all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
inline_cost.py all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
Makefile all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
prep.go all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
queue.go all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
queue_test.go all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
README.md doc: add graph 2022-07-07 09:57:32 +07:00
register.go all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
setup.go all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
sigset.go all: initial files 2022-07-05 04:52:54 +07:00
syscall.go all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
syscall_nr_amd64.go all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
uring.go all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
uring_bench_test.go all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
uring_test.go all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
util_ptr_arith.go all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
util_ptr_arith_test.go all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00
util_union.go all: use of unsafe pointer for ring, and adjustments 2022-07-28 19:45:51 +07:00

gouring

License: MIT Go Reference

go get github.com/ii64/gouring

Example

// setup
h, err := gouring.New(256, 0)
if err != nil { /*...*/ }
defer h.Close() 

sqe := h.GetSQE()
b := []byte("io_uring!\n")
PrepWrite(sqe, 1, &b[0], len(b), 0)

submitted, err := h.SubmitAndWait(1)
if err != nil { /*...*/ }
println(submitted) // 1

var cqe *gouring.IoUringCqe
err = h.WaitCqe(&cqe) 
if err != nil { /*...*/ } // check also EINTR

_ = cqe.UserData
_ = cqe.Res
_ = cqe.Flags

Graph

SQPOLL non-SQPOLL
sqpoll_fig nonsqpoll_fig

Reference

https://github.com/axboe/liburing