I like the idea. I implemented something similar recently and one of the real advantages is that you can kill (suspend, inspect, etc.) such a process. Fast spawning processes are very hard to debug (e.g. in the process browser).
Max > On 24 Feb 2016, at 16:23, Ben Coman <b...@openinworld.com> wrote: > > Just sharing a passing thought so I don't forget it before I have time > to think more deeply on it. > > Several parts of Pharo (like SHTextStyler) are designed to have a > background process running, and when new input arrives that process is > killed so another can be immediately started - and sometimes we seem > to end up with large amounts of zombie processes. > > As I poke around Process>>terminate, I wonder if a different approach > would be to have a Process>>restart. I see there is Context>>restart. > > The starting the background process might look like... > > stylingProcess := [ [ "do stuff with nextData". self suspend ] > repeat ] forkAt: 30. > > and the code in the main morphic priority 40 thread might look like... > > sylingProcess suspend. > nextData := 'blah'. > sylingProcess restart. > > anyway, back to the grind for me, > cheers -ben >