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_) {
95 throw std::logic_error(
96 "sqpoll cannot be enabled with defer_taskrun");
98 if (enable_coop_taskrun_) {
99 throw std::logic_error(
100 "sqpoll cannot be enabled with coop_taskrun");
102 if (enable_sq_rewind_) {
103 throw std::logic_error(
"sqpoll cannot be enabled with sq_rewind");
105 enable_sqpoll_ =
true;
106 sqpoll_idle_time_ms_ = idle_time_ms;
107 sqpoll_thread_cpu_ = cpu;
116 if (enable_sqpoll_) {
117 throw std::logic_error(
118 "defer_taskrun cannot be enabled with sqpoll");
120 if (enable_coop_taskrun_) {
121 throw std::logic_error(
122 "defer_taskrun cannot be enabled with coop_taskrun");
124 enable_defer_taskrun_ =
true;
153 attach_wq_target_ = &other;
162 if (enable_sqpoll_) {
163 throw std::logic_error(
164 "coop_taskrun cannot be enabled with sqpoll");
166 if (enable_defer_taskrun_) {
167 throw std::logic_error(
168 "coop_taskrun cannot be enabled with defer_taskrun");
170 enable_coop_taskrun_ =
true;
180 [[deprecated(
"Use enable_coop_taskrun() without parameters instead")]]
190 if (enable_sqe_mixed_) {
191 throw std::logic_error(
"sqe128 cannot be enabled with sqe_mixed");
193 enable_sqe128_ =
true;
201 if (enable_cqe_mixed_) {
202 throw std::logic_error(
"cqe32 cannot be enabled with cqe_mixed");
204 enable_cqe32_ =
true;
208#if !IO_URING_CHECK_VERSION(2, 13)
213 if (enable_sqe128_) {
214 throw std::logic_error(
"sqe_mixed cannot be enabled with sqe128");
216 enable_sqe_mixed_ =
true;
221#if !IO_URING_CHECK_VERSION(2, 13)
227 throw std::logic_error(
"cqe_mixed cannot be enabled with cqe32");
229 enable_cqe_mixed_ =
true;
234#if !IO_URING_CHECK_VERSION(2, 5)
241 enable_no_mmap_ =
true;
243 no_mmap_buf_size_ = buf_size;
248#if !IO_URING_CHECK_VERSION(2, 14)
253 if (enable_sqpoll_) {
254 throw std::logic_error(
"sq_rewind cannot be enabled with sqpoll");
256 enable_sq_rewind_ =
true;
262 size_t event_interval_ = 61;
263 bool disable_register_ring_fd_ =
false;
264 bool enable_iopoll_ =
false;
265 bool enable_hybrid_iopoll_ =
false;
266 bool enable_sqpoll_ =
false;
267 size_t sqpoll_idle_time_ms_ = 1000;
268 std::optional<uint32_t> sqpoll_thread_cpu_ = std::nullopt;
269 bool enable_defer_taskrun_ =
false;
270 size_t sq_size_ = 128;
272 Runtime *attach_wq_target_ =
nullptr;
273 bool enable_coop_taskrun_ =
false;
274 bool enable_sqe128_ =
false;
275 bool enable_cqe32_ =
false;
276 bool enable_sqe_mixed_ =
false;
277 bool enable_cqe_mixed_ =
false;
278 bool enable_no_mmap_ =
false;
279 void *no_mmap_buf_ =
nullptr;
280 size_t no_mmap_buf_size_ = 0;
281 bool enable_sq_rewind_ =
false;
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.
Self & enable_sq_rewind()
See IORING_SETUP_SQ_REWIND.