-
Notifications
You must be signed in to change notification settings - Fork 360
Home
木头云 edited this page Jan 2, 2019
·
9 revisions
ipc::circ::queue
struct msg_t {
int pid_;
int dat_;
};
using queue_t = ipc::circ::queue<msg_t>;
auto msg_buff = new queue_t::array_t;
// thread 1
std::thread {
[] {
queue_t queue { msg_buff };
for (int i = 0; i < 10; ++i) {
queue.push(msg_t { 0, i });
}
queue.push(msg_t { -1, 0 });
}
}.detach();
// thread 2
std::thread {
[] {
queue_t queue { msg_buff };
queue.connect();
while(1) {
auto msg = queue->pop();
if (msg.pid_ < 0) break;
proc(msg);
}
queue.disconnect();
}
}.detach();
namespaces
classes
ipc::buffer
ipc::circ::elem_array
ipc::circ::queue
ipc::route
ipc::channel
ipc::spin_lock
ipc::rw_lock
ipc::shm::handle
ipc::tls::pointer
ipc::mem::pool_alloc
head files