I need to stop a process from running longer than n seconds, so here’s what I thought I’d do:
|aProcess|
aProcess := [ 10000 timesRepeat: [Transcript show: 'X'] ] fork.
[(Delay forSeconds: 1) wait. aProcess terminate] fork.
I thought this was the proper way to proceed, but it seems to fail from time to time, the Transcript just goes on printing Xes. What bugs me is that it does work sometimes and I can’t figure out what the work/fail pattern is.
This is already in the library, you don’t need to reinvent it.