Re[2]: Возможно ли синхронизовать процессы используя имя исполняемого файла?
От: MaLS Россия https://github.com/maliutin
Дата: 15.02.22 09:48
Оценка: +2
Здравствуйте, Ночной Смотрящий, Вы писали:

НС>У подхода есть потенциальная проблема — имя процесса может и совпать у разных приложений.

Для приложение, которое я просматриваю, не проблема. Там админы гарантируют, что процесса с таким именем не.

НС>И есть особенность — глобальный мьютекс ограничен конкретной сессией, а вот список процессов глобален для всей машины.

А разве это не решается добавлением префикаса Global\?

В документации написано:

On a server that is running Terminal Services, a named system mutex can have two levels of visibility. If its name begins with the prefix "Global\", the mutex is visible in all terminal server sessions. If its name begins with the prefix "Local\", the mutex is visible only in the terminal server session where it was created. In that case, a separate mutex with the same name can exist in each of the other terminal server sessions on the server. If you do not specify a prefix when you create a named mutex, it takes the prefix "Local\". Within a terminal server session, two mutexes whose names differ only by their prefixes are separate mutexes, and both are visible to all processes in the terminal server session. That is, the prefix names "Global\" and "Local\" describe the scope of the mutex name relative to terminal server sessions, not relative to processes.

----
"Ответить на вопрос — значит согласиться с правильностью его постановки.", Карстен Бредемайер
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.