45 disable_register_ring_fd_ =
true;
54 enable_iopoll_ =
true;
55 enable_hybrid_iopoll_ = hybrid;
65 std::optional<uint32_t> cpu = std::nullopt) {
66 if (enable_defer_taskrun_ || enable_coop_taskrun_) {
67 throw std::logic_error(
68 "sqpoll cannot be enabled with defer_taskrun or coop_taskrun");
70 enable_sqpoll_ =
true;
71 sqpoll_idle_time_ms_ = idle_time_ms;
72 sqpoll_thread_cpu_ = cpu;
81 if (enable_sqpoll_ || enable_coop_taskrun_) {
82 throw std::logic_error(
83 "defer_taskrun cannot be enabled with sqpoll or coop_taskrun");
85 enable_defer_taskrun_ =
true;
114 attach_wq_target_ = &other;
123 if (enable_sqpoll_ || enable_defer_taskrun_) {
124 throw std::logic_error(
125 "coop_taskrun cannot be enabled with sqpoll or defer_taskrun");
127 enable_coop_taskrun_ =
true;
137 [[deprecated(
"Use enable_coop_taskrun() without parameters instead")]]
147 if (enable_sqe_mixed_) {
148 throw std::logic_error(
"sqe128 cannot be enabled with sqe_mixed");
150 enable_sqe128_ =
true;
158 if (enable_cqe_mixed_) {
159 throw std::logic_error(
"cqe32 cannot be enabled with cqe_mixed");
161 enable_cqe32_ =
true;
165#if !IO_URING_CHECK_VERSION(2, 13)
170 if (enable_sqe128_) {
171 throw std::logic_error(
"sqe_mixed cannot be enabled with sqe128");
173 enable_sqe_mixed_ =
true;
178#if !IO_URING_CHECK_VERSION(2, 13)
184 throw std::logic_error(
"cqe_mixed cannot be enabled with cqe32");
186 enable_cqe_mixed_ =
true;
191#if !IO_URING_CHECK_VERSION(2, 5)
198 enable_no_mmap_ =
true;
200 no_mmap_buf_size_ = buf_size;
206 size_t event_interval_ = 61;
207 bool disable_register_ring_fd_ =
false;
208 bool enable_iopoll_ =
false;
209 bool enable_hybrid_iopoll_ =
false;
210 bool enable_sqpoll_ =
false;
211 size_t sqpoll_idle_time_ms_ = 1000;
212 std::optional<uint32_t> sqpoll_thread_cpu_ = std::nullopt;
213 bool enable_defer_taskrun_ =
false;
214 size_t sq_size_ = 128;
216 Runtime *attach_wq_target_ =
nullptr;
217 bool enable_coop_taskrun_ =
false;
218 bool enable_sqe128_ =
false;
219 bool enable_cqe32_ =
false;
220 bool enable_sqe_mixed_ =
false;
221 bool enable_cqe_mixed_ =
false;
222 bool enable_no_mmap_ =
false;
223 void *no_mmap_buf_ =
nullptr;
224 size_t no_mmap_buf_size_ = 0;
The event loop runtime for executing asynchronous.
The main namespace for the Condy library.
Self & enable_coop_taskrun(bool taskrun_flag)
See IORING_SETUP_COOP_TASKRUN.
Self & enable_sqe128()
See IORING_SETUP_SQE128.
Self & enable_attach_wq(Runtime &other)
See IORING_SETUP_ATTACH_WQ.
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 & enable_iopoll(bool hybrid=false)
See IORING_SETUP_IOPOLL.
Self & cq_size(size_t v)
Set CQ size.
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 & enable_defer_taskrun()
See IORING_SETUP_DEFER_TASKRUN and IORING_SETUP_TASKRUN_FLAG.