Информация об изменениях

Сообщение Re: В STL почему нет аналога Event Objects(Win32) от 25.02.2015 14:34

Изменено 25.02.2015 14:39 Pavel Dvorkin

Здравствуйте, PowerUserX, Вы писали:

PUX>Почему В STL почему нет аналога Event Objects(Win32)?


ИМХО потому что нет реализации в ядре систем, на которые пришлось все же ориентироваться.

Contrary to popular belief, event objects – a construct particular to MS Windows and not found in *NIX OS:es – are useful in many instances where exact thread execution control is needed. For instance, you may want to have a thread pausing itself while starting another one.
However, if you post a question on a *NIX forum about how to implement event objects or something similar, you will likely get an answer along the lines of “just use mutexes”. Unfortunately, there is no “just” about it. Implementing event objects is a bit tricky, as there are several instances where race conditions or deadlocks can occur.

http://win32eoposix.sourceforge.net/
Re: В STL почему нет аналога Event Objects(Win32)
Здравствуйте, PowerUserX, Вы писали:

PUX>Почему В STL почему нет аналога Event Objects(Win32)?


ИМХО потому что нет реализации в ядре систем, на которые пришлось все же ориентироваться.

Contrary to popular belief, event objects – a construct particular to MS Windows and not found in *NIX OS:es – are useful in many instances where exact thread execution control is needed. For instance, you may want to have a thread pausing itself while starting another one.
However, if you post a question on a *NIX forum about how to implement event objects or something similar, you will likely get an answer along the lines of “just use mutexes”. Unfortunately, there is no “just” about it. Implementing event objects is a bit tricky, as there are several instances where race conditions or deadlocks can occur.

http://win32eoposix.sourceforge.net/

Кстати, в ядре Windows есть еще специальный объект EventPair, для которого можно атомарно дождаться одного ивента пары и установить другой ивент, но в Win API он не экспонируется, только через ntdll.dll