Article View: pl.comp.lang.c
Article #310208Re: Coroutines w (GNU) C
From: Maciek Godek
Date: Wed, 29 Jan 2020 22:22
Date: Wed, 29 Jan 2020 22:22
25 lines
2832 bytes
2832 bytes
W dniu środa, 29 stycznia 2020 22:56:31 UTC+1 użytkownik heby napisał:
> Och, puśc tą samą korutynę 2x w jednym flow, na przemian.
Postanowiłem spróbować. Zmiksowałem ze sobą parzyste i nieparzyste wywołania tej samej korutyny w jednym flow:
void jeden_flow(void) {
ta_sama_korutyna(); // wywołanie nieparzyste
ta_sama_korutyna(); // wywołanie parzyste
ta_sama_korutyna(); // wywołanie nieparzyste
ta_sama_korutyna(); // wywołanie parzyste
}
dla porównania tutaj mam po prostu ciąg wywołań tej samej korutyny, bez przemieszania:
void bez_miksowania(void) {
ta_sama_korutyna(); // pierwsze wywołanie
ta_sama_korutyna(); // drugie wywołanie
ta_sama_korutyna(); // trzecie wywołanie
ta_sama_korutyna(); // czwarte wywołanie
}
Ku mojemu zdziwieniu, oba zachowały się dokładnie tak samo.
Technical Details
Message-ID:
<c92296d7-d5e1-4097-9e28-93faa004da73@googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!news.samoylyk.net!news.uzoreto.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!g89no826847qtd.0!news-out.google.com!w29ni988qtc.0!nntp.google.com!g89no826839qtd.0!postnews.google.com!google-groups.googlegroups.com!not-for-mailReferences:
<4375b52d-ba21-462a-8844-9bd1a02e9ece@googlegroups.com> <r0k8i5$ifg$1@dont-email.me> <ce3f0b08-658f-4248-b82c-09f093a7f20c@googlegroups.com> <r0kq6d$v6h$1@dont-email.me> <748c5d16-f4a8-43a0-8a56-bea0800e1e04@googlegroups.com> <r0n95e$35l$1@dont-email.me> <f3df206c-11d4-4b22-87ff-fc7aa00935f3@googlegroups.com> <r0nevq$9iq$1@dont-email.me> <ecae4ae1-0b06-4956-8df0-593fa0f1cd01@googlegroups.com> <r0njjv$740$1@dont-email.me> <0e0786af-7b58-4070-b8cd-81f1bda1f432@googlegroups.com> <r0q9iv$23b$1@dont-email.me> <b7cfec93-1d13-44e3-a924-0869447ed3c7@googlegroups.com> <r0seqp$av0$1@dont-email.me> <462689f9-f50d-4a96-8910-cb65757a017a@googlegroups.com> <r0st86$956$1@dont-email.me> <cc360fba-2eab-4928-8e14-36db20fa4a96@googlegroups.com> <r0sv2c$k80$1@dont-email.me>Show Full Headers
Complete Article Headers
X-Received: by 2002:a0c:c24f:: with SMTP id w15mr1499058qvh.66.1580336589011; Wed, 29 Jan 2020 14:23:09 -0800 (PST) X-Received: by 2002:a25:8502:: with SMTP id w2mr1376269ybk.161.1580336580152; Wed, 29 Jan 2020 14:23:00 -0800 (PST) Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!news.samoylyk.net!news.uzoreto.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!g89no826847qtd.0!news-out.google.com!w29ni988qtc.0!nntp.google.com!g89no826839qtd.0!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: pl.comp.lang.c Date: Wed, 29 Jan 2020 14:22:59 -0800 (PST) In-Reply-To: <r0sv2c$k80$1@dont-email.me> Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=83.25.200.96; posting-account=f7iIKQoAAAAkDKpUafc-4IXhmRAzdB5r NNTP-Posting-Host: 83.25.200.96 References: <4375b52d-ba21-462a-8844-9bd1a02e9ece@googlegroups.com> <r0k8i5$ifg$1@dont-email.me> <ce3f0b08-658f-4248-b82c-09f093a7f20c@googlegroups.com> <r0kq6d$v6h$1@dont-email.me> <748c5d16-f4a8-43a0-8a56-bea0800e1e04@googlegroups.com> <r0n95e$35l$1@dont-email.me> <f3df206c-11d4-4b22-87ff-fc7aa00935f3@googlegroups.com> <r0nevq$9iq$1@dont-email.me> <ecae4ae1-0b06-4956-8df0-593fa0f1cd01@googlegroups.com> <r0njjv$740$1@dont-email.me> <0e0786af-7b58-4070-b8cd-81f1bda1f432@googlegroups.com> <r0q9iv$23b$1@dont-email.me> <b7cfec93-1d13-44e3-a924-0869447ed3c7@googlegroups.com> <r0seqp$av0$1@dont-email.me> <462689f9-f50d-4a96-8910-cb65757a017a@googlegroups.com> <r0st86$956$1@dont-email.me> <cc360fba-2eab-4928-8e14-36db20fa4a96@googlegroups.com> <r0sv2c$k80$1@dont-email.me> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <c92296d7-d5e1-4097-9e28-93faa004da73@googlegroups.com> Subject: Re: Coroutines w (GNU) C From: Maciek Godek <godek.maciek@gmail.com> Injection-Date: Wed, 29 Jan 2020 22:23:08 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit