From 25a10e5a233057b77cb8ad4f9dc0c357ac91d692 Mon Sep 17 00:00:00 2001 From: YoSTEALTH Date: Mon, 15 Jul 2024 05:46:02 -0600 Subject: [PATCH] entry: not going to use `flags=IOSQE_ASYNC` as default since it has a bug in `io_uring`, also not good for performance! https://github.com/axboe/liburing/issues/1181 --- src/shakti/__init__.py | 2 +- src/shakti/event/entry.pyx | 4 ++-- src/shakti/event/run.pxd | 3 +-- src/shakti/event/run.pyx | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/shakti/__init__.py b/src/shakti/__init__.py index bb5d021..367c617 100644 --- a/src/shakti/__init__.py +++ b/src/shakti/__init__.py @@ -1,7 +1,7 @@ from dynamic_import import importer -__version__ = '2024.7.13' +__version__ = '2024.7.15' importer() # helps this project manage all import needs. diff --git a/src/shakti/event/entry.pyx b/src/shakti/event/entry.pyx index b6e9cc1..a015140 100644 --- a/src/shakti/event/entry.pyx +++ b/src/shakti/event/entry.pyx @@ -5,7 +5,7 @@ cdef class SQE(io_uring_sqe): # note: `num` is used by `io_uring_sqe` def __init__(self, __u16 num=1, bint error=True, *, - unsigned int flags=IOSQE_ASYNC, unsigned int link_flag=IOSQE_IO_HARDLINK): + unsigned int flags=0, unsigned int link_flag=IOSQE_IO_HARDLINK): ''' Shakti Queue Entry Type @@ -72,8 +72,8 @@ cdef class SQE(io_uring_sqe): def __await__(self): cdef: - __u16 i SQE sqe + __u16 i if self.len == 1: # single self.job = ENTRY diff --git a/src/shakti/event/run.pxd b/src/shakti/event/run.pxd index 35f6c68..22f83fc 100644 --- a/src/shakti/event/run.pxd +++ b/src/shakti/event/run.pxd @@ -1,8 +1,7 @@ from cpython.object cimport PyObject from cpython.ref cimport Py_XINCREF, Py_XDECREF from liburing.lib.type cimport __s32, __u64, uintptr_t -from liburing.queue cimport IOSQE_ASYNC, \ - io_uring, io_uring_queue_init, io_uring_queue_exit, \ +from liburing.queue cimport io_uring, io_uring_queue_init, io_uring_queue_exit, \ io_uring_prep_nop, io_uring_submit, io_uring_cqe, io_uring_sq_ready, \ io_uring_cq_advance, io_uring_wait_cqe, io_uring_for_each_cqe, \ io_uring_sqe_set_flags, io_uring_sqe_set_data64 diff --git a/src/shakti/event/run.pyx b/src/shakti/event/run.pyx index 5efcfe6..5fa65f3 100644 --- a/src/shakti/event/run.pyx +++ b/src/shakti/event/run.pyx @@ -85,7 +85,6 @@ cdef void __prep_coroutine(io_uring ring, tuple coroutine, unsigned int coro_len sqe.job = CORO sqe.coro = coroutine[i] io_uring_prep_nop(sqe) - io_uring_sqe_set_flags(sqe, IOSQE_ASYNC) io_uring_sqe_set_data64(sqe, <__u64>ptr) io_uring_put_sqe(ring, sqe)