#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/sync/interprocess_mutex.hpp>
#include <boost/interprocess/sync/interprocess_condition.hpp>
#include <boost/interprocess/sync/scoped_lock.hpp>
#include <iostream>
#include <unistd.h>
#include <semaphore.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <time.h>
#include <sched.h>
struct timespec hipretime;
struct processMsg {
uint64_t timenow;
uint32_t frameId;
processMsg()
{
timenow = 0;
frameId = 0;
}
};
/*************************************
Function:
Author :
Date : 2019/10/26
*************************************/
int main()
{
try {
std::cout<<"Pub begin....."<<std::endl;
boost::interprocess::managed_shared_memory managed_shm(boost::in
进程之间条件变量的同步
最新推荐文章于 2024-09-15 22:46:22 发布
本文介绍如何在Linux环境下使用条件变量进行进程间的同步。通过编译命令展示了在包含librt和pthread库的情况下,编译进程子程序(process_sub.cpp)和父程序(process_pub.cpp)的过程。
摘要由CSDN通过智能技术生成