RDMA++
Loading...
Searching...
No Matches
cq_poller.h
1#pragma once
2
3#include <atomic>
4#include <functional>
5#include <memory>
6#include <thread>
7
8#include <infiniband/verbs.h>
9
10#include "rdmapp/cq.h"
11#include "rdmapp/executor.h"
12
13namespace rdmapp {
14
19class cq_poller {
20 std::shared_ptr<cq> cq_;
21 std::atomic<bool> stopped_;
22 std::thread poller_thread_;
23 std::shared_ptr<executor> executor_;
24 std::vector<struct ibv_wc> wc_vec_;
25 void worker();
26
27public:
34 cq_poller(std::shared_ptr<cq> cq, size_t batch_size = 16);
35
43 cq_poller(std::shared_ptr<cq> cq, std::shared_ptr<executor> executor,
44 size_t batch_size = 16);
45
46 ~cq_poller();
47};
48
49} // namespace rdmapp
This class is used to poll a completion queue.
Definition cq_poller.h:19
This class is an abstraction of a Completion Queue.
Definition cq.h:22
This class is used to execute callbacks of completion entries.
Definition executor.h:17