help-smalltalk
[Top][All Lists]
Advanced

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

Re: [Help-smalltalk] [PATCH] kernel: Check the Semaphore before queuing


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] [PATCH] kernel: Check the Semaphore before queuing the interrupt
Date: Tue, 21 Jan 2014 18:11:47 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Il 20/01/2014 20:30, Holger Hans Peter Freyther ha scritto:
On Mon, Jan 20, 2014 at 05:30:52PM +0100, Paolo Bonzini wrote:
The patch looks good.

Alternatively, what about this?  It is a bit clearer to me, but the
logic is pretty much the same.

Thanks!

                 (self timedWaitOn: sem) ifTrue: [
-                   proc signalInterrupt: (Kernel.TimeoutNotification on: self).
+                   timeout = 0 ifTrue: [
+                       proc signalInterrupt: (Kernel.TimeoutNotification on: 
self)].
                 ].

If we ever get the execution of multiple native processes the timeout
code and the aBlock ensure:[] could run at the same time. How would we
make that mutual exclusive? add a lock/token then?

We probably would need syntax for atomic compare and exchange of OOPs.

Paolo




reply via email to

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