45 disable_register_ring_fd_ =
true;
54 [[deprecated(
"Use enable_iopoll() and enable_hybrid_iopoll() instead")]]
57#if !IO_URING_CHECK_VERSION(2, 9)
69 enable_iopoll_ =
true;
73#if !IO_URING_CHECK_VERSION(2, 9)
78 if (!enable_iopoll_) {
79 throw std::logic_error(
80 "hybrid_iopoll cannot be enabled without iopoll");
82 enable_hybrid_iopoll_ =
true;
93 std::optional<uint32_t> cpu = std::nullopt) {
94 if (enable_defer_taskrun_ || enable_coop_taskrun_) {
95 throw std::logic_error(
96 "sqpoll cannot be enabled with defer_taskrun or coop_taskrun");
98 enable_sqpoll_ =
true;
99 sqpoll_idle_time_ms_ = idle_time_ms;
100 sqpoll_thread_cpu_ = cpu;
109 if (enable_sqpoll_ || enable_coop_taskrun_) {
110 throw std::logic_error(
111 "defer_taskrun cannot be enabled with sqpoll or coop_taskrun");
113 enable_defer_taskrun_ =
true;
142 attach_wq_target_ = &other;
151 if (enable_sqpoll_ || enable_defer_taskrun_) {
152 throw std::logic_error(
153 "coop_taskrun cannot be enabled with sqpoll or defer_taskrun");
155 enable_coop_taskrun_ =
true;
165 [[deprecated(
"Use enable_coop_taskrun() without parameters instead")]]
175 if (enable_sqe_mixed_) {
176 throw std::logic_error(
"sqe128 cannot be enabled with sqe_mixed");
178 enable_sqe128_ =
true;
186 if (enable_cqe_mixed_) {
187 throw std::logic_error(
"cqe32 cannot be enabled with cqe_mixed");
189 enable_cqe32_ =
true;
193#if !IO_URING_CHECK_VERSION(2, 13)
198 if (enable_sqe128_) {
199 throw std::logic_error(
"sqe_mixed cannot be enabled with sqe128");
201 enable_sqe_mixed_ =
true;
206#if !IO_URING_CHECK_VERSION(2, 13)
212 throw std::logic_error(
"cqe_mixed cannot be enabled with cqe32");
214 enable_cqe_mixed_ =
true;
219#if !IO_URING_CHECK_VERSION(2, 5)
226 enable_no_mmap_ =
true;
228 no_mmap_buf_size_ = buf_size;
234 size_t event_interval_ = 61;
235 bool disable_register_ring_fd_ =
false;
236 bool enable_iopoll_ =
false;
237 bool enable_hybrid_iopoll_ =
false;
238 bool enable_sqpoll_ =
false;
239 size_t sqpoll_idle_time_ms_ = 1000;
240 std::optional<uint32_t> sqpoll_thread_cpu_ = std::nullopt;
241 bool enable_defer_taskrun_ =
false;
242 size_t sq_size_ = 128;
244 Runtime *attach_wq_target_ =
nullptr;
245 bool enable_coop_taskrun_ =
false;
246 bool enable_sqe128_ =
false;
247 bool enable_cqe32_ =
false;
248 bool enable_sqe_mixed_ =
false;
249 bool enable_cqe_mixed_ =
false;
250 bool enable_no_mmap_ =
false;
251 void *no_mmap_buf_ =
nullptr;
252 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_iopoll(bool hybrid)
See IORING_SETUP_IOPOLL.
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 & enable_defer_taskrun()
See IORING_SETUP_DEFER_TASKRUN and IORING_SETUP_TASKRUN_FLAG.