Re: Killing arbitrary coroutines
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Killing arbitrary coroutines
- From: Tony Finch <dot@...>
- Date: 2012年1月19日 15:11:42 +0000
andre@leiradella.com <andre@leiradella.com> wrote:
> and then put a check in all other coroutine functions so as soon as the
> coroutine yields again it gets killed (i.e. a deferred stop.) Although
> this works I'd rather avoid having the coroutine run just to be killed
> when it yields as it can take a while if the coroutine is sleeping for a
> long period of time, leaving me with a useless "zoombie" coroutine that
> could be doing useful work.
Resume the coroutine immediately so that it commits suicide. No need to
wait for it to be scheduled.
Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/
South-east Iceland: Westerly 7 or gale 8 backing southerly or southwesterly 5
to 7 later. Rough or very rough near iceland, otherwise high. Squally showers.
Good.