<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 09/19/2014 11:20 AM, Xiangrong Fang
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAP93jB2ZZGREsLoCuQp77O3Bu_J9RNFKMGB_wAiCrQPW1A8wxw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_default" style="font-family:courier
          new,monospace">Hi,</div>
        <div class="gmail_default" style="font-family:courier
          new,monospace"><br>
        </div>
        <div class="gmail_default" style="font-family:courier
          new,monospace">In a previous email asking about PostMessage,
          Michael suggested I used QueueAsyncCall instead,</div>
      </div>
    </blockquote>
    In fact now that I know what you are trying to accomplish (a Thread
    Pool) I take back the suggestion of QueueAsyncCall, as same is
    supported by Lazarus (LCL) and not directly by fpc (RTL). As I feel
    that a ThreadPool should be working independently of the GUI, I
    would use TThread.Synchronize or TThread.Queue. <br>
    <br>
    In fact I did a TThreadPool component that works nicely for me. This
    is discussed in the Lazarus Forum (even though I think it should
    better be discussed here, as it does not use any Lazarus features.<br>
    <br>
    <blockquote
cite="mid:CAP93jB2ZZGREsLoCuQp77O3Bu_J9RNFKMGB_wAiCrQPW1A8wxw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_default" style="font-family:courier
          new,monospace">My question is, why cannot Lazarus just use
          PostMessage, but invent the QueueAsyncCall() method?<br>
        </div>
      </div>
    </blockquote>
    <br>
    Windows is a "Message driven" OS. This might be nice but other OSes
    don't support or force this paradigm. <br>
    <br>
    As fpc is supposed to be as portable as possible, it can't work
    "Message driven" under the hood, which is not supported by other
    OSes. <br>
    <br>
    To support Code ported from Delphi, "PostMessage" is provided by
    Lazarus in the LCL (but AFAIK, not by fpc, which can be used without
    Lazarus / LCL) <br>
    <br>
    -Michael<br>
  </body>
</html>