Note that there are some explanatory texts on larger screens.

plurals
  1. POHow Do I Choose Between the Various Ways to do Threading in Delphi?
    primarykey
    data
    text
    <p>It seems that I've finally got to implement some sort of threading into my Delphi 2009 program. If there were only one way to do it, I'd be off and running. But I see several possibilities.</p> <p>Can anyone explain what's the difference between these and why I'd choose one over another.</p> <ol> <li><p>The TThread class in Delphi</p></li> <li><p><a href="http://andy.jgknet.de/blog/?page_id=100" rel="noreferrer">AsyncCalls</a> by <a href="https://stackoverflow.com/users/44005/andreas-hausladen">Andreas Hausladen</a></p></li> <li><p><a href="http://otl.17slon.com/" rel="noreferrer">OmniThreadLibrary</a> by <a href="https://stackoverflow.com/users/4997/gabr">Primoz Gabrijelcic (gabr)</a></p></li> <li><p>... any others?</p></li> </ol> <hr> <p>Edit:</p> <p>I have just read an excellent article by Gabr in the March 2010 (No 10) issue of <a href="http://www.blaisepascal.eu/" rel="noreferrer">Blaise Pascal Magazine</a> titled "Four Ways to Create a Thread". You do have to subscribe to gain content to the magazine, so by copyright, I can't reproduce anything substantial about it here.</p> <p>In summary, Gabr describes the difference between using TThreads, direct Windows API calls, Andy's AsyncCalls, and his own OmniThreadLibrary. He does conclude at the end that:</p> <blockquote> <p>"I'm not saying that you have to choose anything else than the classical Delphi way (TThread) but it is still good to be informed of options you have"</p> </blockquote> <p>Mghie's answer is very thorough and suggests OmniThreadLibrary may be preferable. But I'm still interested in everyone's opinions about how I (or anyone) should choose their threading method for their application. </p> <p>And you can add to the list:</p> <p>. 4. Direct calls to the Windows API</p> <p>. 5. <a href="https://stackoverflow.com/users/195109/misha">Misha Charrett's</a> <a href="http://csinnovations.com/framework/framework.htm" rel="noreferrer">CSI Distributed Application Framework</a> as suggested by LachlanG in his answer.</p> <hr> <p>Conclusion:</p> <p>I'm probably going to go with OmniThreadLibrary. I like Gabr's work. I used his profiler GPProfile many years ago, and I'm currently using his GPStringHash which is actually part of OTL.</p> <p>My only concern might be upgrading it to work with 64-bit or Unix/Mac processing once Embarcadero adds that functionality into Delphi.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload