Net Core教程

C# 进程间的同步 EventWaitHandle

本文主要是介绍C# 进程间的同步 EventWaitHandle,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

  private const string Event_GUID = "{7D63AEC9-771C-4701-9A6E-FFAA88EC01EF}";

 

进程A.

 public static EventWaitHandle SystemSyncEvent { get; set; }

 SystemSyncEvent = EventWaitHandle.OpenExisting(Event_GUID);

 ewh.Set();

 

进程B.

 private const string Event_GUID = "{7D63AEC9-771C-4701-9A6E-FFAA88EC01EF}";

 public static EventWaitHandle SystemSyncEvent { get; set; }

 SystemSyncEvent = EventWaitHandle.OpenExisting(Event_GUID);

 SystemSyncEvent.WaitOne();//等待plc托管wcf服务启动完成

 

这篇关于C# 进程间的同步 EventWaitHandle的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!