[bug] CPU usage is high when there is an exception

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug] CPU usage is high when there is an exception

MrGwen
Issue status update for
http://smalltalk.gnu.org/node/427
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/427

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VisualGST
 Category:     bug reports
 Priority:     critical
 Assigned to:  Unassigned
 Reported by:  MrGwen
 Updated by:   MrGwen
 Status:       active

When there is an exception in VisualGST gst take uses 100% of the CPU.




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [bug] CPU usage is high when there is an exception

Paolo Bonzini-3
Issue status update for
http://smalltalk.gnu.org/project/issue/427
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/427

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VisualGST
 Category:     bug reports
 Priority:     critical
 Assigned to:  Unassigned
 Reported by:  MrGwen
 Updated by:   bonzinip
 Status:       active

This would fix it:

diff --git a/packages/gtk/GtkImpl.st b/packages/gtk/GtkImpl.st
index 6a2d2fc..6097775 100644
--- a/packages/gtk/GtkImpl.st
+++ b/packages/gtk/GtkImpl.st
@@ -502,7 +502,7 @@ Gtk class extend [
         GTK.Gtk main: sem.
         sem wait.
         
-        [GTK.Gtk mainIterationDo: false.
+        [GTK.Gtk mainIterationDo: true.
         GTK.Gtk shouldQuit]
                 whileFalse: [Processor yield]
     ]

but I have to check the impact on simulation speed (e.g. does moving
the mouse increase the speed of simulation? that would be bad!).  To
fix it properly, the glib event loop should be hacked up to run the
event loop together with Smalltalk code:


    *  Place the main loop at high priority and make it do something
like this: 1) use g_main_context_set_poll_func and in the poll function
set up SIGIO notification for the file descriptors, call
g_main_context_pending to get this poll function called; 2) wait on a
semaphore to be triggered by the SIGIO notifications; 3) revert to the
default poll function and call g_main_context_iteration in non-blocking
mode.
    *  Besides this, in sysdep/win32/events.c use
MsgWaitForSingleObjects instead of WaitForSingleObject



_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [bug] CPU usage is high when there is an exception

Paolo Bonzini-3
In reply to this post by MrGwen
Issue status update for
http://smalltalk.gnu.org/project/issue/427
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/427

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VisualGST
 Category:     bug reports
-Priority:     critical
+Priority:     normal
-Assigned to:  Unassigned
+Assigned to:  bonzinip
 Reported by:  MrGwen
 Updated by:   bonzinip
-Status:       active
+Status:       postponed

Postponed to past 3.1.




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [bug] CPU usage is high when there is an exception

MrGwen
In reply to this post by MrGwen
Issue status update for
http://smalltalk.gnu.org/project/issue/427
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/427

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VisualGST
 Category:     bug reports
 Priority:     normal
 Assigned to:  bonzinip
 Reported by:  MrGwen
 Updated by:   MrGwen
 Status:       postponed

diff --git a/packages/gtk/GtkImpl.st b/packages/gtk/GtkImpl.st
index 6a2d2fc..6097775 100644
--- a/packages/gtk/GtkImpl.st

+++  b/packages/gtk/GtkImpl.st

@@ -502,7 +502,7 @@ Gtk class extend [
        GTK.Gtk main: sem.
        sem wait.
       
-        [GTK.Gtk mainIterationDo: false.

+         [GTK.Gtk mainIterationDo: true.

        GTK.Gtk shouldQuit]
                whileFalse: [Processor yield]
    ]

This fix does not solve the problem




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk