Re: [fpc-pascal] PostMessage vs. QueueAsyncCall

2014-09-19 Thread Mattias Gaertner
On Fri, 19 Sep 2014 17:20:27 +0800 Xiangrong Fang wrote: >[...] > My question is, why cannot Lazarus just use PostMessage, but invent the > QueueAsyncCall() method? What is the rationale, or, why PostMessage is > considered windows-ish (read: not fit into LCL very well?), apart from the > fact t

Re: [fpc-pascal] PostMessage vs. QueueAsyncCall

2014-09-19 Thread Michael Schnell
On 09/19/2014 11:20 AM, Xiangrong Fang wrote: Hi, In a previous email asking about PostMessage, Michael suggested I used QueueAsyncCall instead, 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 Laza

[fpc-pascal] PostMessage vs. QueueAsyncCall

2014-09-19 Thread Xiangrong Fang
Hi, In a previous email asking about PostMessage, Michael suggested I used QueueAsyncCall instead, because although it's OK to use PostMessage, but it is considered a Windows Legacy, or only for Delphi compatibility. However, in actual use, I feel that PostMessage does a better job for code separ

Re: [fpc-pascal] Optimal number of threads for SMP

2014-09-19 Thread Michael Schnell
On 09/18/2014 06:53 PM, Bernd wrote: If it reports 4 CPUs then you have exactly 4 CPUs. Correct from a algorithm POV, but not from a performance POV. -Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-

Re: [fpc-pascal] Optimal number of threads for SMP

2014-09-19 Thread Michael Schnell
On 09/15/2014 11:19 AM, Marco van de Voort wrote: too many threads increasing switching time and thus decreases performance Not only this. Additionally Linux tries to keep a thread/Task at the same CPU when re-scheduling the CPUs. By this the count of misses on the (primary) caches is decrea