PDA

View Full Version : CPU Overload


tuongkha
02-14-2008, 11:10 AM
Hi,
I modified something in StockListDemo code, and re-built it success.
Here my changed :
-------------------------
constructor:
create a map to hold all snapshots
(let's create an IDictionary and call it _snaps)

method Start:
start a new thread with the following behaviour:
every 5 seconds:
read the file
for each stock:
create an IDictionary to store all field name/value pairs
associate the IDictionary to the stock name in _snaps
(the previous association, if any, should be garbage collected)
call onEvent on the listener and send the IDictionary

method SendCurrentValues:
get the IDictionary associated to the requested item name in _snap
if found:
call onEvent on the listener and send the IDictionary
else
call onEvent on the listener with an empty IDictionary

(you can see detail at http://www.lightstreamer.com/vb/showthread.php?t=247)

------------------

Now I start LS and DotNetServer.bat, my CPU always 100% (in Windows Task : DotNetServer.exe has CPU = 45%, iexplore has CPU = 35%). My code does not performance or something I wrong? Can u help me?

skidrow406
03-26-2008, 04:36 AM
schema="field1 field2 field3"
ma chi su dung field1 field2 thi se bi 100%

codingvn
05-02-2008, 06:23 AM
schema="field1 field2 field3"
ma chi su dung field1 field2 thi se bi 100%
Hi tuongkha !
I has met the problem too. Do you fix it ???
Pls help me. Thanks