木头云
木头云
没什么问题的话,我 merge 到 master 了哈
The value of `8*1024*1024` is nothing special in the library. It specifies the size of a single element in the circular buffer, while the buffer size is 255. This means...
额,你用的是哪个demo?确实如你所说,channel是一个全局的通道,进程可以接收到自己发出去的消息,但我在recv里把自己的消息丢弃了。虽然如此,双向通信还是建议用两个channel,性能会好很多。 你这个现象不确定是不是bug,完整测试用的是这段代码么? ```c++ while (!cc.send(datas[i])) { // waiting for connection cc.wait_for_recv(2); // 这里等待2个连接的原因是,thread producer的cc自身也是一个连接(ipc::receiver) } ``` 另外在问题出现之前是否有意外退出的行为?
对的,需要捕获signal,手动disconnect一下。主要是因为linux的共享内存文件是一直存在的,这会导致各种奇怪的问题。
emm...当然是手搓的。。我注释确实写得少了点,重构分支里在反省了。。 你哪里有疑问?可以提出来我看看
嗯,你这种方式是actor模型。目前master分支的ipc,通讯模型是csp模型,recv函数会堵塞等待消息到达。你说的sleep,比如[send_recv](https://github.com/mutouyun/cpp-ipc/tree/master/demo/send_recv)里,是用来模拟发送间隔的。
你应该在 cpp-ipc-master 文件夹下面建 build 文件夹,然后 cd 进去 `cmake ..`
你是咋用的?进程内通信也是支持的
WSL2 and the host should communicate over the network, and cannot communicate with each other using shared memory.
原因是因为打断点了吗?看起来好像是因为断点导致的超时。周末有空我看看。