smalltalk - Defining a maximum running time for a process -


i need stop process running longer n seconds, here's thought i'd do:

|aprocess| aprocess := [ 10000 timesrepeat: [transcript show: 'x'] ] fork. [(delay forseconds: 1) wait. aprocess terminate] fork. 

i thought proper way proceed, seems fail time time, transcript goes on printing xes. bugs me work , can't figure out work/fail pattern is.

this in library, don't need reinvent it.

[10000 timesrepeat: [transcript show: 'x']]      valuewithin: 1 second ontimeout: [transcript show: 'stop'] 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -