View Issue Details

IDProjectCategoryView StatusLast Update
0036904LazarusOtherpublic2020-04-13 03:50
ReporterVojtech Cihak Assigned ToMartin Friebe  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformamd64OSLinux 
Product Version2.1 (SVN) 
Fixed in Version2.2 
Summary0036904: High CPU ioad in multithreading demo
DescriptionDemo ..examples/multithreading/multithreadingexample1.lpr has high CPU load.
I added sleep(5); to the thread's loop to decrease CPU load.
Steps To ReproduceTry demo multithreadingexample1.lpr and look at CPU load (it is 54% om Core2Duo).

Apply patch and try again. CPU load is negligible now.
Additional InformationLazarus 2.1.0 r61214:62923M FPC 3.3.1 x86_64-linux-qt
TagsNo tags attached.
Fixed in Revision62953
LazTarget2.2
Widgetset
Attached Files

Activities

Vojtech Cihak

2020-04-13 00:09

reporter  

demo.diff (353 bytes)   
Index: examples/multithreading/mainunit.pas
===================================================================
--- examples/multithreading/mainunit.pas	(revision 62923)
+++ examples/multithreading/mainunit.pas	(working copy)
@@ -103,6 +103,7 @@
       fStatusText := newStatus;
       Synchronize(@Showstatus);
     end;
+    sleep(5);
   end;
 end;
 
demo.diff (353 bytes)   

Martin Friebe

2020-04-13 01:55

manager   ~0122104

Thanks, applied.

I made it sleep(50). The update is only once a second.
I added a comment.

Vojtech Cihak

2020-04-13 03:50

reporter   ~0122105

Thanks.

Issue History

Date Modified Username Field Change
2020-04-13 00:09 Vojtech Cihak New Issue
2020-04-13 00:09 Vojtech Cihak File Added: demo.diff
2020-04-13 01:50 Martin Friebe Assigned To => Martin Friebe
2020-04-13 01:50 Martin Friebe Status new => assigned
2020-04-13 01:55 Martin Friebe Status assigned => resolved
2020-04-13 01:55 Martin Friebe Resolution open => fixed
2020-04-13 01:55 Martin Friebe Fixed in Version => 2.2
2020-04-13 01:55 Martin Friebe Fixed in Revision => 62953
2020-04-13 01:55 Martin Friebe LazTarget => 2.2
2020-04-13 01:55 Martin Friebe Note Added: 0122104
2020-04-13 03:50 Vojtech Cihak Status resolved => closed
2020-04-13 03:50 Vojtech Cihak Note Added: 0122105