RDMA++
Loading...
Searching...
No Matches
cq_poller.h
1#pragma once
2
3#include <atomic>
4#include <memory>
5#include <thread>
6
7#include <infiniband/verbs.h>
8
9#include "rdmapp/cq.h"
10#include "rdmapp/executor.h"
11
12namespace rdmapp {
13
18class cq_poller {
19 std::shared_ptr<cq> cq_;
20 std::atomic<bool> stopped_;
21 std::shared_ptr<executor> executor_;
22 std::vector<struct ibv_wc> wc_vec_;
23 std::thread poller_thread_;
24 void worker();
25
26public:
33 cq_poller(std::shared_ptr<cq> cq, size_t batch_size = 16);
34
42 cq_poller(std::shared_ptr<cq> cq, std::shared_ptr<executor> executor,
43 size_t batch_size = 16);
44
45 ~cq_poller();
46};
47
48} // namespace rdmapp
This class is used to poll a completion queue.
Definition cq_poller.h:18
cq_poller(std::shared_ptr< cq > cq, size_t batch_size=16)
Construct a new cq poller object. A new executor will be created.
Definition cq_poller.cc:15
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