УМННБJ, ЯХВ. Войти !bnw Сегодня Клубы
Привет, TbI — HRWKA! 1235.0 пользователей не могут ошибаться!
?6913
прекрасное6424
говно5887
говнорашка5512
хуита4695
anime3056
linux2645
music2625
bnw2590
рашка2561
log2339
ололо2115
pic1815
дунч1734
сталирасты1488
украина1437
быдло1435
bnw_ppl1371
дыбр1237
гімно1158

http://www.cs.wustl.edu/~schmidt/win32-cv-1.html > Both Win32 events and POSIX condition variables provide similar waiting, signaling, and broadcasting features. For instance, WaitForMultipleObjects can acquire a mutex and wait on an event simultaneously via the waitAll flag and SignalObjectAndWait can release a mutex and wait on an event atomically. These functions provide semantics akin to the pthread_cond_wait and pthread_cond_signal. Thus, there are instances where either events and condition variables can be used interchangably. > However, extreme care must be taken with Win32 events to ensure that there are no race conditions introduced when switching from one mechanism to another. Unfortunately, there's no way to release just one waiting thread with a manual-reset event. Likewise, there's no way to release all waiting threads with an auto-reset event. This limitation is a major source of difficulty when implementing condition variables, as shown in Section 3. > After years of repeatedly seeing Win32 implementations of condition variables posted in newsgroups like comp.programming.threads it became apparent that many Win32 implementations are either incorrect or contain subtle problems that can lead to starvation, unfairness, or race conditions. To help developers avoid these problems, this article evaluates common strategies for implementing POSIX condition variables on Win32, illustrating common traps and pitfalls and ways to avoid them.
#DSX439 (0+1) / @octagram / 4322 дня назад
Как удалённо усыпить/пробудить тред? Linux-специфичные хаки, не предусмотренные pthread'ами, тоже устраивают.
#7F1SM0 (2) / @l29ah / 4431 день назад
Бэнвач, подскажи. Есть у меня несколько тредов, которые должны принимать-отсылать данные через один udp сокет. Дескриптор сокета создается в main(дескриптор сокета обьявлен глобально), затем стартуются треды. Столкнулся я с тем, что recvfrom возвращает bad file descriptor.
#CL6SRZ (0) / @grouzen / 4828 дней назад
ipv6 ready BnW для ведрофона BnW на Реформале Викивач Котятки

Цоперайт © 2010-2016 @stiletto.