且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

互斥体名称-***做法?

更新时间:2023-11-13 22:54:34

全局互斥锁的真正安全名称是<a description> + <a GUID>:

A really safe name for a global mutex is <a description> + <a GUID>:

MyApp Single Instance Mutex : {c96f7db4-d743-4718-bef0-8533a198bcca}

使用这样的名称,绝对没有其他人会使用与您的互斥锁相同的互斥锁名称.

By using a name like this there is absolutely no chance someone else will use the same mutex name as your mutex.

与流程浏览器一起嗅探,您可以看到在一些地方使用了GUID,尽管通常不使用它们.确实出现了一种模式,即互斥"一词被大量使用,微软似乎喜欢使用国会大厦.

Sniffing around with process explorer, you can see that GUIDs are used in a few places, though in general they are not used. A pattern that does emerge though is that the word "mutex" is used quite a lot and Microsoft seem to like using capitols.