tmonitor

TMonitor.Pulse vs TMonitor.PulseAll

做~自己de王妃 提交于 2019-12-07 04:19:12
问题 The Delphi Docwiki explains that Pulse notifies the next thread in the waiting queue that it will be able to lock the specified object as soon as the calling thread releases the object. PulseAll signals all threads in the waiting queue. I found this code which uses Pulse in a threaded queue implementation, and given the definition above, think that PulseAll should be used - or asked in a different way: when is it correct to use Pulse instead of PulseAll? (Where the basic question is: how can

TMonitor.Pulse vs TMonitor.PulseAll

时光毁灭记忆、已成空白 提交于 2019-12-05 09:17:40
The Delphi Docwiki explains that Pulse notifies the next thread in the waiting queue that it will be able to lock the specified object as soon as the calling thread releases the object. PulseAll signals all threads in the waiting queue. I found this code which uses Pulse in a threaded queue implementation, and given the definition above, think that PulseAll should be used - or asked in a different way: when is it correct to use Pulse instead of PulseAll? (Where the basic question is: how can I be sure that the 'next thread in the queue' is alyways the thread who needs to be notified, except in

What is TMonitor in Delphi System unit good for?

自闭症网瘾萝莉.ら 提交于 2019-11-29 22:13:12
After reading the articles "Simmering Unicode, bring DPL to a boil" and "Simmering Unicode, bring DPL to a boil (Part 2)" of "The Oracle at Delphi" (Allen Bauer), Oracle is all I understand :) The article mentions Delphi Parallel Library (DPL), lock free data structures, mutual exclusion locks and condition variables (this Wikipedia article forwards to ' Monitor (synchronization) ', and then introduces the new TMonitor record type for thread synchronization and describes some of its methods. Are there introduction articles with examples which show when and how this Delphi record type can be

What is TMonitor in Delphi System unit good for?

爷,独闯天下 提交于 2019-11-28 18:51:32
问题 After reading the articles "Simmering Unicode, bring DPL to a boil" and "Simmering Unicode, bring DPL to a boil (Part 2)" of "The Oracle at Delphi" (Allen Bauer), Oracle is all I understand :) The article mentions Delphi Parallel Library (DPL), lock free data structures, mutual exclusion locks and condition variables (this Wikipedia article forwards to 'Monitor (synchronization)', and then introduces the new TMonitor record type for thread synchronization and describes some of its methods.