Can a .NET Semaphore be shared between users on the same computer?

I need to restrict access to a shared resource between 2 users logged into Terminal Server sessions (Windows 2008 R2 x64). From my tests, it appears one user cannot see the named system Semaphore already created by another user. If I try sharing a Semaphore within the same user account, that works. Should I be able to share this across accounts?

Answers


You need to create a global semaphore that's visible across sessions. Prefix its name with Global\.


Need Your Help


About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.