rapid notification that process-stop has done its stuff?
Unable to parse email body. Email id is 11810
Unable to parse email body. Email id is 11810
Hi Nick, This may not be suited to your need if your process must be stopped in the middle of some processing. I send a message to the process' mailbox, and use process-join to wait for the process to finish gracefully. I have very good results with this approach. Best, Cam On 28 nov. 2012, at 13:03, Nick Levine <ndl@ravenbrook.com> wrote: > > I want to stop another process. I don't want to proceed until I am > certain that this other process has stopped. Here's what I do: > > (defun stop-thread (thread) > (unless (eq thread (mp:get-current-process)) > (mp:process-stop thread) > (mp:process-wait "Waiting for other thread to stop" > 'mp:process-stopped-p > thread))) > > Sometimes this works really smoothly. But sometimes it takes a second > or two. I wrapped some timing code around the wait function; it > appears that the wait function is called a couple of times in the > first millisecond and then not again for up to several hundred > milliseconds. > > If I were waiting for anything other than a process-stop I could use > process-wait-local and process-poke. Obviously I can't use these here. > > So what should I do? > > - nick > > _______________________________________________ > Lisp Hug - the mailing list for LispWorks users > lisp-hug@lispworks.com > http://www.lispworks.com/support/lisp-hug.html > _______________________________________________ Lisp Hug - the mailing list for LispWorks users lisp-hug@lispworks.com http://www.lispworks.com/support/lisp-hug.html