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

2014-09-18 Thread Marco van de Voort
In our previous episode, Mark Morgan Lloyd said: > > Hyperthreading doubles the execution stream logic, so that one core can > > take two incoming streams of instructions. The idea is that when one thread > > stalls, or executes unoptimal code, the other thread can run, increasing > > utilization.

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

2014-09-18 Thread Mark Morgan Lloyd
Marco van de Voort wrote: Hyperthreading doubles the execution stream logic, so that one core can take two incoming streams of instructions. The idea is that when one thread stalls, or executes unoptimal code, the other thread can run, increasing utilization. But that is more something like 10%,

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

2014-09-18 Thread Marco van de Voort
In our previous episode, Bernd said: > If the CPU has hyper threading then these should show up as individual > cores (CPUs). They call a "core" with 2 processors on it a "core" but > each of these "cores" is actually two complete processors (cores in > the conventional meaning of the word) that ju

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

2014-09-18 Thread Bernd
2014-09-15 11:10 GMT+02:00 Xiangrong Fang : > (hyper-threads)? If the CPU has hyper threading then these should show up as individual cores (CPUs). They call a "core" with 2 processors on it a "core" but each of these "cores" is actually two complete processors (cores in the conventional meaning

Re: [fpc-pascal] Random thread lockup. QueueAsyncCall??

2014-09-18 Thread Xiangrong Fang
2014-09-18 23:10 GMT+08:00 Xiangrong Fang : > > I suspect that it is blocked on the RTLeventWaitFor, because if I use this: > > RTLeventWaitFor(Barrier, 1000); > > It will periodically pause for 1 second, then continue. > I found the problem myself. Instead of writing: while not Terminated d

[fpc-pascal] Random thread lockup. QueueAsyncCall??

2014-09-18 Thread Xiangrong Fang
Hi There, I am writing my "prime finder" app to understand how thread synchronization works. I tried two methods (critical section and rtlevent), both have problem. For example the rtlevent version will run for a while then randomly stops. However, after the thread stops working it seems that th

Re: [fpc-pascal] ReadXMLFile in fcl-xml package

2014-09-18 Thread Mattias Gaertner
On Thu, 18 Sep 2014 09:43:21 +0200 LacaK wrote: > Hi, > I use ReadXMLFile from fcl-xml package to read XML file in UTF-8 encoding. > Then I parse Nodes and use TextContent property which is string in > system encoding ... but I need it in UTF-8 encoding. > So I use again UTF8Encode(Node.TextCont

[fpc-pascal] ReadXMLFile in fcl-xml package

2014-09-18 Thread LacaK
Hi, I use ReadXMLFile from fcl-xml package to read XML file in UTF-8 encoding. Then I parse Nodes and use TextContent property which is string in system encoding ... but I need it in UTF-8 encoding. So I use again UTF8Encode(Node.TextContent). Is there any SIMPLE way how to say that ReadXMLFile