Thema: Delphi Running Threads

Einzelnen Beitrag anzeigen

mjustin

Registriert seit: 14. Apr 2008
3.005 Beiträge
 
Delphi 2009 Professional
 
#3

Re: Running Threads

  Alt 24. Mär 2010, 06:15
Einfache Lösung: eine globale Integer Variable per TCriticalSection sichern und dann in den Threads eim Start erhöhen und am Ende verringern.

Alternativ kann mann TIdThreadSafeInteger aus Indy oder InterlockedIncrement/Decrement aus der Windows API verwenden (ist in Delphi bereits unterstützt).

p.s.: die OmniThreadLibrary ist noch erwähnenswert.

Zitat:
OmniThreadLibrary is simple to use threading library for Delphi. Currently, versions 2007, 2009, and 2010 are supported. OmniThreadLibrary is an open source project. It lives in the Google Code and is licensed under the BSD license.

...

OTL's main "selling" points (besides the price, of course are power, simplicity, and openess. With just few lines of code, you can set up multiple threads, send messages between them, process Windows messages and more.
TThreadList ist keine Liste von Threads
Michael Justin
  Mit Zitat antworten Zitat