help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Fix the continue back into GTK/Event-Loop/C-code


From: Gwenaël Casaccio
Subject: Re: [Help-smalltalk] Fix the continue back into GTK/Event-Loop/C-code
Date: Wed, 23 Oct 2013 09:30:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

On 22/10/2013 23:44, Holger Hans Peter Freyther wrote:
On Mon, Oct 21, 2013 at 12:55:16PM +0200, Gwenaël Casaccio wrote:
Hi,

here is a patch that fix the continue back into GTK/Event-Loop/C-code
(with the debugger and text widget).
thank you very much!


-        self isLastContextSelected ifFalse: [ self stepToSelectedContext ].
-        debugger step.
-        self updateContextWidget
+        TaskQueue uniqueInstance add: [
+            self isLastContextSelected ifFalse: [ self stepToSelectedContext ].
+            debugger step.
+            self updateContextWidget ]
after having looked at the blox code, what do you think about something
like this:


        self debugWith: [debugger step]

and

        debugWith: aBlock [
                TaskQueue uniqueInstance add: [
                        self isLastContextSelected ..
                        aBlock value.
                        self updateContextWidget
                ]
        ]

?

+    run [
+        <category: 'accessing'>
+
+        [ | task sem |
+          sem := Semaphore new.
+          [ queue peek.
+            [ queue isEmpty ] whileFalse: [
+              task := queue next.
+              [ task ensure: [ sem signal ] ] fork"At: Processor 
userBackgroundPriority".
+              sem wait ] ] repeat ] fork
+    ]
* What prevents the VM to gc this process?
I don't see why the vm would gc the process
* I assume the queue peek can be removed? Same for the "At:.." comment?
even better:

+    run [
+        <category: 'accessing'>
+
+        [ | task sem |
+          sem := Semaphore new.
+          [ task := queue next.
+            [ task ensure: [ sem signal ] ] fork.
+            sem wait ] repeat ] fork
+    ]

* After looking into "updating" code at runtime I try to avoid having
   too much code in a '[] repeat'
yeah







reply via email to

[Prev in Thread] Current Thread [Next in Thread]