Редактирование: Monitors and Wait Conditions in Qt (Part 2)
Материал из Wiki.crossplatform.ru
Внимание: Вы не представились системе. Ваш IP-адрес будет записан в историю изменений этой страницы.
Правка может быть отменена. Пожалуйста, просмотрите сравнение версий, чтобы убедиться, что это именно те изменения, которые вас интересуют, и нажмите «Записать страницу», чтобы изменения вступили в силу.
Текущая версия | Ваш текст | ||
Строка 1: | Строка 1: | ||
- | + | __NOTOC__ | |
by Jasmin Blanchette | by Jasmin Blanchette | ||
Строка 5: | Строка 5: | ||
In the previous issue of Qt Quarterly, we saw how to synchronizethreads using monitors, a high-level synchronization mechanism. Wealso reviewed the code of two examples, BankAccount andBoundedBuffer, that showed how to implement monitors using QMutex andQWaitCondition. In this issue, we will review a few fundamentaltechniques for developing more powerful monitors than those presentedpreviously. | In the previous issue of Qt Quarterly, we saw how to synchronizethreads using monitors, a high-level synchronization mechanism. Wealso reviewed the code of two examples, BankAccount andBoundedBuffer, that showed how to implement monitors using QMutex andQWaitCondition. In this issue, we will review a few fundamentaltechniques for developing more powerful monitors than those presentedpreviously. | ||
- | + | *[[#coveringconditions | Covering Conditions]] | |
+ | *[[#passingthecondition | Passing the Condition]] | ||
+ | *[[#fairnessandprioritywait | Fairness and Priority Wait]] | ||
+ | *[[#assumptionsandinvariants | Assumptions and Invariants]] | ||
+ | *[[#monitorsversussemaphores | Monitors versus Semaphores]] | ||
+ | *[[#conclusion | Conclusion]] | ||
</div> | </div> | ||
More precisely, we will study the following four techniques: coveringconditions, "passing the condition", priority wait, and invariants.We will also compare monitors with semaphores and show how theyrelate to each other. Most of the techniques and examples are drawnfrom Gregory Andrews's textbook ''Multithreaded, Parallel, andDistributed Programming'' (2000). | More precisely, we will study the following four techniques: coveringconditions, "passing the condition", priority wait, and invariants.We will also compare monitors with semaphores and show how theyrelate to each other. Most of the techniques and examples are drawnfrom Gregory Andrews's textbook ''Multithreaded, Parallel, andDistributed Programming'' (2000). |