Questions tagged [tmonitor]
7 questions
34
votes
1 answer
What is TMonitor in Delphi System unit good for?
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…

mjn
- 36,362
- 28
- 176
- 378
11
votes
1 answer
In Delphi, what does System.TMonitor.Pulse and TMonitor.PulseAll actually do
I was very pleased to see Delphi introduce the TMonitor record in Delphi 2009, permitting you to lock specific objects in a multithreaded environment. What has puzzled me is the Pulse and PulseAll methods of this record type.
For example, the entry…

Cary Jensen
- 3,751
- 3
- 32
- 55
5
votes
1 answer
TMonitor.Pulse vs TMonitor.PulseAll
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…

mjn
- 36,362
- 28
- 176
- 378
2
votes
2 answers
TMonitor synchronization / Application.ProcessMessages
I'm back with another question concerning threads and synchronization. Imagine a server application that has to perform a lengthy operation and the client wants his GUI to remain responsive while he waits for the server's response. I thought of the…

jpfollenius
- 16,456
- 10
- 90
- 156
2
votes
4 answers
Invalid pointer operation in TMonitor.Destroy
I'm currently working on porting an existing Delphi 5 application to Delphi 2010.
It's a multithreaded DLL (where the threads are spawned by Outlook) that loads into Outlook. When compiled through Delphi 2010, whenever I close a form I run into an…

Paul-Jan
- 16,746
- 1
- 63
- 95
1
vote
1 answer
Is it safe to use locking (TMonitor) wihtin Enumerator's constructor/destructor?
I have simple thread safe container class. It has standard add/remove methods.
Normally enumerating items is implemented as:
MyList.lock;
try
// looping here
finally
MyList.unlock;
end;
But I want to take advantage of for-in support in a…

iPath ツ
- 2,468
- 20
- 31
1
vote
0 answers
How is TMonitor "broken" in Delphi 2009?
There are some bug reports on the Internet which say that in Delphi 2009 the TMonitor synchronisation class implementation was severely broken.
However I have also found pages which show fixes (patches) for like here: TMonitor bug? -…

mjn
- 36,362
- 28
- 176
- 378