↑↑↓↓←→←→ⒷⒶ Войти !bnw Сегодня Клубы
Привет, TbI — HRWKA! 1245.1 пользователей не могут ошибаться!
?6986
прекрасное6456
говно5921
говнорашка5512
хуита4735
anime3077
linux2662
music2643
bnw2607
рашка2584
log2372
ололо2241
дунч1868
pic1816
сталирасты1494
bnw_ppl1443
быдло1440
украина1438
дыбр1238
гімно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 / 4946 дней назад
Как удалённо усыпить/пробудить тред? Linux-специфичные хаки, не предусмотренные pthread'ами, тоже устраивают.
#7F1SM0 (2) / @l29ah / 5055 дней назад
Бэнвач, подскажи. Есть у меня несколько тредов, которые должны принимать-отсылать данные через один udp сокет. Дескриптор сокета создается в main(дескриптор сокета обьявлен глобально), затем стартуются треды. Столкнулся я с тем, что recvfrom возвращает bad file descriptor.
#CL6SRZ (0) / @grouzen / 5451 день назад
ipv6 ready BnW для ведрофона BnW на Реформале Викивач Котятки

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