Deutsch English Français Italiano |
<v74ct9$tuk4$3@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro <ldo@nz.invalid> Newsgroups: comp.arch Subject: Re: Continuations Date: Mon, 15 Jul 2024 23:55:21 -0000 (UTC) Organization: A noiseless patient Spider Lines: 14 Message-ID: <v74ct9$tuk4$3@dont-email.me> References: <v6tbki$3g9rg$1@dont-email.me> <4j389jlb44kuhi3o5igf8ucnks3q9m3lc8@4ax.com> <v714in$1foh$2@gal.iecc.com> <lfims1Fl57mU1@mid.individual.net> <v71jfh$jko$1@gal.iecc.com> <pFdlO.42948$BYv6.40771@fx09.iad> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 16 Jul 2024 01:55:22 +0200 (CEST) Injection-Info: dont-email.me; posting-host="55f74b4ae2f116c131f41dc172ef4daf"; logging-data="981636"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19DXdymt/BcwNPhQFQSJZIw" User-Agent: Pan/0.158 (Avdiivka; ) Cancel-Lock: sha1:yqAqd2Aqoh6zePjrZFguHHiUHo8= Bytes: 1808 On Mon, 15 Jul 2024 14:12:32 -0400, EricP wrote: > The effect is that code bounces from action routine to action routine > carrying its execute context with it, waiting for something external, > evaluating the result and deciding what action to do next. The thing that coroutines bring to the table is that you don’t have to break up the code that executes in this common context into separate pieces that are each invoked via a callback and end in a reschedule call. Intead, you just write it as a single block, with explicit “await” calls at the various points along the way where rescheduling happens. The net result is the logic is much easier to follow, and there is often less of it.