47 "This option is deprecated and will be removed in future versions")]]
49 disable_register_ring_fd_ =
true;
57 enable_iopoll_ =
true;
61#if !IO_URING_CHECK_VERSION(2, 9)
66 if (!enable_iopoll_) {
67 throw std::logic_error(
68 "hybrid_iopoll cannot be enabled without iopoll");
70 enable_hybrid_iopoll_ =
true;
81 std::optional<uint32_t> cpu = std::nullopt) {
82 if (enable_defer_taskrun_) {
83 throw std::logic_error(
84 "sqpoll cannot be enabled with defer_taskrun");
86 if (enable_coop_taskrun_) {
87 throw std::logic_error(
88 "sqpoll cannot be enabled with coop_taskrun");
90 if (enable_sq_rewind_) {
91 throw std::logic_error(
"sqpoll cannot be enabled with sq_rewind");
93 enable_sqpoll_ =
true;
94 sqpoll_idle_time_ms_ = idle_time_ms;
95 sqpoll_thread_cpu_ = cpu;
104 if (enable_sqpoll_) {
105 throw std::logic_error(
106 "defer_taskrun cannot be enabled with sqpoll");
108 if (enable_coop_taskrun_) {
109 throw std::logic_error(
110 "defer_taskrun cannot be enabled with coop_taskrun");
112 enable_defer_taskrun_ =
true;
149 attach_wq_target_ = &other;
158 if (enable_sqpoll_) {
159 throw std::logic_error(
160 "coop_taskrun cannot be enabled with sqpoll");
162 if (enable_defer_taskrun_) {
163 throw std::logic_error(
164 "coop_taskrun cannot be enabled with defer_taskrun");
166 enable_coop_taskrun_ =
true;
174 if (enable_sqe_mixed_) {
175 throw std::logic_error(
"sqe128 cannot be enabled with sqe_mixed");
177 enable_sqe128_ =
true;
185 if (enable_cqe_mixed_) {
186 throw std::logic_error(
"cqe32 cannot be enabled with cqe_mixed");
188 enable_cqe32_ =
true;
192#if !IO_URING_CHECK_VERSION(2, 13)
197 if (enable_sqe128_) {
198 throw std::logic_error(
"sqe_mixed cannot be enabled with sqe128");
200 enable_sqe_mixed_ =
true;
205#if !IO_URING_CHECK_VERSION(2, 13)
211 throw std::logic_error(
"cqe_mixed cannot be enabled with cqe32");
213 enable_cqe_mixed_ =
true;
218#if !IO_URING_CHECK_VERSION(2, 5)
225 enable_no_mmap_ =
true;
227 no_mmap_buf_size_ = buf_size;
232#if !IO_URING_CHECK_VERSION(2, 14)
237 if (enable_sqpoll_) {
238 throw std::logic_error(
"sq_rewind cannot be enabled with sqpoll");
240 enable_sq_rewind_ =
true;
246 size_t event_interval_ = 61;
247 bool disable_register_ring_fd_ =
false;
248 bool enable_iopoll_ =
false;
249 bool enable_hybrid_iopoll_ =
false;
250 bool enable_sqpoll_ =
false;
251 size_t sqpoll_idle_time_ms_ = 1000;
252 std::optional<uint32_t> sqpoll_thread_cpu_ = std::nullopt;
253 bool enable_defer_taskrun_ =
false;
254 size_t sq_size_ = 128;
256 size_t submit_batch_ = 0;
257 Runtime *attach_wq_target_ =
nullptr;
258 bool enable_coop_taskrun_ =
false;
259 bool enable_sqe128_ =
false;
260 bool enable_cqe32_ =
false;
261 bool enable_sqe_mixed_ =
false;
262 bool enable_cqe_mixed_ =
false;
263 bool enable_no_mmap_ =
false;
264 void *no_mmap_buf_ =
nullptr;
265 size_t no_mmap_buf_size_ = 0;
266 bool enable_sq_rewind_ =
false;
The event loop runtime for executing asynchronous.
The main namespace for the Condy library.
Self & enable_sqe128()
See IORING_SETUP_SQE128.
Self & enable_attach_wq(Runtime &other)
See IORING_SETUP_ATTACH_WQ.
Self & enable_iopoll()
See IORING_SETUP_IOPOLL.
Self & sq_size(size_t v)
Set SQ size.
Self & enable_no_mmap(void *buf=nullptr, size_t buf_size=0)
See IORING_SETUP_NO_MMAP.
Self & cq_size(size_t v)
Set CQ size.
Self & enable_hybrid_iopoll()
See IORING_SETUP_HYBRID_IOPOLL.
Self & disable_register_ring_fd()
Disable register ring fd.
Self & enable_coop_taskrun()
See IORING_SETUP_COOP_TASKRUN and IORING_SETUP_TASKRUN_FLAG.
Self & enable_cqe32()
See IORING_SETUP_CQE32.
Self & event_interval(size_t v)
Set event interval.
Self & enable_cqe_mixed()
See IORING_SETUP_CQE_MIXED.
Self & enable_sqpoll(size_t idle_time_ms=1000, std::optional< uint32_t > cpu=std::nullopt)
See IORING_SETUP_SQPOLL.
Self & enable_sqe_mixed()
See IORING_SETUP_SQE_MIXED.
Self & submit_batch(size_t v)
Set batch size for operation submission.
Self & enable_defer_taskrun()
See IORING_SETUP_DEFER_TASKRUN and IORING_SETUP_TASKRUN_FLAG.
Self & enable_sq_rewind()
See IORING_SETUP_SQ_REWIND.