小编Ral*_*lfL的帖子

使用SharedMemory MMF实现快速.NET无锁进程

我是新手multitasking,IPC并且我正在尝试使用共享内存构建一种快速进程间通信的方法(起初我正在研究IPC术语,考虑到wcf sockets并且named pipes最终只发现MMF).

现在我已经通过使用LockEventWaitHandle信令在两个进程之间使用共享内存成功实现了一个小测试,我采用了一种实现非阻塞/无等待模式的方法.现在,我正在尝试结合Thread.MemoryBarrier()并阅读signalling Sector来自MemoryMapedFile.

问题是身份不明!第一轮通过,第二轮最后一个位于百慕大三角...超出了调试器的范围......

过程中发送请求的突发的showMsg()处理b.

                                         //offset positions in mmf
MemoryMappedViewAccessor MmfAcc; const int opReady= 0, opCompleteRead = 4, .....



ReadTrd()
{
  //[0,3] - Reader is stationed
  //[4,7] - Read Complete successfully
  //[8,11] - Data-size 
  //[12,15] - Reader-exiting
  "format" the signals Section (write zeroes). 

   for(;;){if (WrTrd-StepMMF1  Confimed) break;}
  MmfAcc- read DataSize val @offset[8]
  MmfAcc- read …
Run Code Online (Sandbox Code Playgroud)

c# performance multithreading ipc wait-free

6
推荐指数
1
解决办法
933
查看次数

标签 统计

c# ×1

ipc ×1

multithreading ×1

performance ×1

wait-free ×1