I think nowadays we could actually switch to a fully event/timer driven main loop for Morphic without major drawbacks. This was not true when Morphic was designed, since the VM back then was not event-based. Instead of a fixed interCyclePause we simply need to wait on a semaphore that should get signaled when a new event is available, and timed-out when the next Morphic alarm / step message is due. It probably also needs to be triggered when a deferred UI message is added. On the VM side, we would need to replace relinquishProcessorForMicrosec The advantage of this would be, as Holger wrote, that we would become a lot more battery-efficient, since we would wake up only if there is actual work to do. - Bert - On Wed, Aug 30, 2017 at 7:56 AM, Marcel Taeumel <[hidden email]> wrote:
|
Hi Bert,
When the scheduler discovers no runnable process exists it enters a wait state that blocks on events (including potential socket and file i/o) with a time out that expires at the next scheduled delay, if any. This wait state must also be abortable via an internally generated event used, for example, when a callback occurs on some other thread. On Windows this is possible by including a semaphore in (IIRC)MsgWaitForMultipleEvebts. In unixes it is typically achieved by ensuring that select/poll/epoll/kqueue is interruptible and delivering a signal to interrupt it. One concern is backward compatibility. It may be possible for the VM to run both old and new schemes without additional state, simply relying on the occurrence or absence of a relinquishProcessorForMicrosec
Best, Eliot _,,,^..^,,,_ (phone)
|
Whilst thinking about this let us please keep in mind leaving some hooks for use cases where there is no interrupt-type incoming events - older OSs (<cough>RISC OS, Mac OS 9, Windows pre-whatever) or bare-metal systems with essentially no OS. I don’t think either case should prevent us moving forward but at least leaving open, clean, avenues for them to keep working would be nice.
tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim You can't make a program without broken egos. |
Hi Tim,
> On Aug 30, 2017, at 10:39 AM, tim Rowledge <[hidden email]> wrote: > > Whilst thinking about this let us please keep in mind leaving some hooks for use cases where there is no interrupt-type incoming events - older OSs (<cough>RISC OS, Mac OS 9, Windows pre-whatever) or bare-metal systems with essentially no OS. I don’t think either case should prevent us moving forward but at least leaving open, clean, avenues for them to keep working would be nice. IMO, leaving it up to the VM to decide what to do when there's nothing to do allows better support on those other OSs and bare metal than leaving it up to the image to provide some catch all hack like the background process calling relinquishProcessorForMilliseconds. > > tim > -- > tim Rowledge; [hidden email]; http://www.rowledge.org/tim > You can't make a program without broken egos. > > > |
> On 30-08-2017, at 12:14 PM, Eliot Miranda <[hidden email]> wrote: > > Hi Tim, > >> On Aug 30, 2017, at 10:39 AM, tim Rowledge <[hidden email]> wrote: >> >> Whilst thinking about this let us please keep in mind leaving some hooks for use cases where there is no interrupt-type incoming events - older OSs (<cough>RISC OS, Mac OS 9, Windows pre-whatever) or bare-metal systems with essentially no OS. I don’t think either case should prevent us moving forward but at least leaving open, clean, avenues for them to keep working would be nice. > > IMO, leaving it up to the VM to decide what to do when there's nothing to do allows better support on those other OSs and bare metal than leaving it up to the image to provide some catch all hack like the background process calling relinquishProcessorForMilliseconds. No argument there. I won’t even argue that RISC OS is an important case these days, and that’s possibly the last in-use OS that requires the vm to be ‘in charge’ whilst running and to voluntarily surrender control in order to keep things going. I’d just like to make sure there is a small flag waving somewhere reminding us that there are systems we might want to support that are not unix/windows/mac. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Strange OpCodes: DNPG: Do Not Pass Go |
On Wed, Aug 30, 2017 at 02:49:54PM -0700, tim Rowledge wrote:
> > > On 30-08-2017, at 12:14 PM, Eliot Miranda <[hidden email]> wrote: > > > > Hi Tim, > > > >> On Aug 30, 2017, at 10:39 AM, tim Rowledge <[hidden email]> wrote: > >> > >> Whilst thinking about this let us please keep in mind leaving some hooks for use cases where there is no interrupt-type incoming events - older OSs (<cough>RISC OS, Mac OS 9, Windows pre-whatever) or bare-metal systems with essentially no OS. I don???t think either case should prevent us moving forward but at least leaving open, clean, avenues for them to keep working would be nice. > > > > IMO, leaving it up to the VM to decide what to do when there's nothing to do allows better support on those other OSs and bare metal than leaving it up to the image to provide some catch all hack like the background process calling relinquishProcessorForMilliseconds. > > No argument there. I won???t even argue that RISC OS is an important case these days, and that???s possibly the last in-use OS that requires the vm to be ???in charge??? whilst running and to voluntarily surrender control in order to keep things going. I???d just like to make sure there is a small flag waving somewhere reminding us that there are systems we might want to support that are not unix/windows/mac. > I for one think that RISC OS (or any other non-unix platform, take your pick) remains an important use case. I personally think very highly of Unix, and as the author of OSProcess I have taken an active role in making platform specific functions available to Squeak images. But all the world is not Unix. Never was, never will be, and never should be. Smalltalk stands for a different way of thinking. It pains me every time someone insists on adding a new platform-specific feature just because it exists on Unix and maybe-sort-of works on Windows. So bravo for RISC OS, SqueakNOS, SqueakJS, and Android VMs, keep them coming. Dave |
Free forum by Nabble | Edit this page |