Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #57495

Re: polyForth multitasker question

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: polyForth multitasker question
Date 2017-04-17 15:13 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2017Apr17.171308@mips.complang.tuwien.ac.at> (permalink)
References <ocafkt$1929$1@gioia.aioe.org> <ocpr1b$p4b$1@dont-email.me> <6_ydnXUzTNeS523FnZ2dnUU7-THNnZ2d@supernews.com> <2017Apr14.095322@mips.complang.tuwien.ac.at> <ocsut2$v0f$1@cherry.spenarnc.xs4all.nl>

Show all headers | View raw


albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) writes:
>In article <2017Apr14.095322@mips.complang.tuwien.ac.at>,
>Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
>>"Elizabeth D. Rather" <erather@forth.com> writes:
>>>In fact, it's far less complicated than that. Each task knows how long
>>>it's sleeping, and each time around the round-robin checks to see if it's
>>>wake-up time yet. A very few instructions each time.
>>
>>If you have 100 tasks waiting in MS, that's maybe 1000 instructions
>>and 100 cache line touches (20% of the L1 cache of a recent Intel CPU)
>>every time a working task PAUSEs.  And if you have 1000 such tasks,
>>every PAUSE scrubs the L1 cache and causes 1000 L1 cache misses (i.e.,
>>about 50000 cycles from the cache misses alone).  It's simple, but it
>>does not scale.
>
>We all know that

has the same meaning as "It's not true that".

>the Intel processors are a bad design, especially for
>this kind of thing.

It's a poor craftsman that blames his tools.  Remember Snabb
<https://lwn.net/Articles/713918/>?  It runs on Intel processors and
has an average of 70ns (i.e. 1.4 T800 cycles) to process a packet.

> On a transputer e.g. the task switch between
>worker tasks would be instantaneous

Nothing is instantaneous; it's a bit hard to find numbers, but
<http://www.classiccmp.org/transputer/> claims that "process context
switching time can be as little as one microsecond.".

And the issue at hand is not the task switch (that would consume about
20 cycles (5ns @4GHz, 200 times faster than a transputer) on a recent
Intel CPU if the switched-to task is in L2 cache, and about 60 cycles
(15ns @4GHz, still 66 times faster than a transputer) if it is in L3
cache).

Instead, the issue is how to deal with waiting tasks.  And there the
Forth, Inc. way has a similar issue on the transputer as on current
high-performance CPUs: Either you put the stuff that's accessed on
visiting into the on-chip RAM, consuming a significant amount of these
valuable resources, or you put it in off-chip RAM, and then going
through all the stopped tasks costs quite a bit of time, and going
through the "running" tasks that run MS costs even more time.

>What Elizabeth sketches (and what you would do on a transputer)
>is have one task counting the MS, that would wake up other
>tasks.

No, what she sketched is that the time is updated by an interrupt, and
every task waiting in MS is actually a "running" task that checks if
its time has come, and if not PAUSEs.

>>And it burns CPU when everything is waiting.
>
>If the CPU has nothing to do you waste computer power.
>Whether you waste energy that depends much of hardware design.

When you run code, this costs energy.  Of course you can design
computers to burn just as much when halted, but that kind of design
has fallen out of favour quite some time ago.  Instead, hardware
designers have made great efforts to burn less whenever the
opportunity offers itself.

>There is no way you can avoid trouble on an Intel if there
>are more task switches per second than can accomodated.

There is no way you can avoid trouble on anything if there are more
anything required than can be accomodated.  But that is not the issue
at hand.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2016: http://www.euroforth.org/ef16/

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

polyForth multitasker question "HAA" <someone@microsoft.com> - 2017-04-08 20:53 +1000
  Re: polyForth multitasker question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-08 12:29 -0500
    Re: polyForth multitasker question "HAA" <someone@microsoft.com> - 2017-04-10 09:50 +1000
      Re: polyForth multitasker question David Schultz <abuse@127.0.0.1> - 2017-04-09 19:25 -0500
        Re: polyForth multitasker question "HAA" <someone@microsoft.com> - 2017-04-10 10:52 +1000
          Re: polyForth multitasker question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-10 08:58 -0500
            Re: polyForth multitasker question "HAA" <someone@microsoft.com> - 2017-04-15 10:39 +1000
        Re: polyForth multitasker question "HAA" <someone@microsoft.com> - 2017-04-11 11:12 +1000
          Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-10 18:22 -0700
            Re: polyForth multitasker question "HAA" <someone@microsoft.com> - 2017-04-11 12:17 +1000
          Re: polyForth multitasker question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-11 03:10 -0500
      Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-09 14:37 -1000
        Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-09 18:05 -0700
          Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-09 15:50 -1000
          Re: polyForth multitasker question Lars Brinkhoff <lars.spam@nocrew.org> - 2017-04-10 07:47 +0200
        Re: polyForth multitasker question "HAA" <someone@microsoft.com> - 2017-04-10 12:20 +1000
        Re: polyForth multitasker question Alex <alex@rivadpm.com> - 2017-04-10 09:11 +0100
          Re: polyForth multitasker question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-10 04:20 -0500
            Re: polyForth multitasker question Alex <alex@rivadpm.com> - 2017-04-10 10:53 +0100
              Re: polyForth multitasker question Alex <alex@rivadpm.com> - 2017-04-10 11:24 +0100
              Re: polyForth multitasker question "HAA" <someone@microsoft.com> - 2017-04-11 12:05 +1000
                Re: polyForth multitasker question Alex <alex@rivadpm.com> - 2017-04-11 14:27 +0100
                Re: polyForth multitasker question minforth@arcor.de - 2017-04-11 07:08 -0700
                Re: polyForth multitasker question foxaudioresearch@gmail.com - 2017-04-11 18:06 -0700
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-11 18:58 -0700
                Re: polyForth multitasker question foxaudioresearch@gmail.com - 2017-04-12 13:57 -0700
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-12 18:02 -0700
                Re: polyForth multitasker question foxaudioresearch@gmail.com - 2017-04-12 19:47 -0700
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-12 21:22 -0700
                Re: polyForth multitasker question foxaudioresearch@gmail.com - 2017-04-13 02:57 -0700
                Re: polyForth multitasker question minforth@arcor.de - 2017-04-12 23:17 -0700
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-13 00:13 -0700
                Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-13 09:43 -1000
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-13 19:34 -0700
                Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-13 19:57 -1000
                Re: polyForth multitasker question rickman <gnuarm@gmail.com> - 2017-04-14 02:45 -0400
                Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-13 21:28 -1000
                Re: polyForth multitasker question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-14 07:53 +0000
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-14 01:44 -0700
                Re: polyForth multitasker question minforth@arcor.de - 2017-04-14 02:01 -0700
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-14 11:28 -0700
                Re: polyForth multitasker question rickman <gnuarm@gmail.com> - 2017-04-14 16:23 -0400
                Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-13 22:46 -1000
                Re: polyForth multitasker question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-14 11:31 +0000
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-14 11:23 -0700
                Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-14 10:06 -1000
                Re: polyForth multitasker question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-14 08:13 -0500
                Re: polyForth multitasker question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-14 14:12 +0000
                Re: polyForth multitasker question pahihu <pahihu@gmail.com> - 2017-04-14 09:30 -0700
                Re: polyForth multitasker question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-15 08:46 +0000
                Re: polyForth multitasker question pahihu <pahihu@gmail.com> - 2017-04-15 13:07 -0700
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-15 17:27 -0700
                Re: polyForth multitasker question foxaudioresearch@gmail.com - 2017-04-15 18:18 -0700
                Re: polyForth multitasker question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-17 13:53 +0000
                Re: polyForth multitasker question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-14 11:34 -0500
                Re: polyForth multitasker question hughaguilar96@gmail.com - 2017-04-14 11:31 -0700
                Re: polyForth multitasker question Julian Fondren <julian.fondren@gmail.com> - 2017-04-14 12:14 -0700
                Re: polyForth multitasker question hughaguilar96@gmail.com - 2017-04-14 12:46 -0700
                Re: polyForth multitasker question hughaguilar96@gmail.com - 2017-04-14 12:48 -0700
                Re: polyForth multitasker question hughaguilar96@gmail.com - 2017-04-14 12:50 -0700
                Re: polyForth multitasker question albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-15 14:39 +0200
                Re: polyForth multitasker question Julian Fondren <julian.fondren@gmail.com> - 2017-04-15 11:48 -0700
                Re: polyForth multitasker question Alex <alex@rivadpm.com> - 2017-04-14 22:07 +0100
                Re: polyForth multitasker question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-15 16:47 +0000
                Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-15 11:36 -1000
                Re: polyForth multitasker question foxaudioresearch@gmail.com - 2017-04-15 17:07 -0700
                Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-15 14:17 -1000
                Re: polyForth multitasker question hughaguilar96@gmail.com - 2017-04-15 18:27 -0700
                Re: polyForth multitasker question Ron Aaron <rambamist@gmail.com> - 2017-04-16 06:53 +0300
                Re: polyForth multitasker question hughaguilar96@gmail.com - 2017-04-15 22:00 -0700
                Re: polyForth multitasker question Ron Aaron <rambamist@gmail.com> - 2017-04-16 08:59 +0300
                Re: polyForth multitasker question lehs <skydda.barnen@gmail.com> - 2017-04-15 22:19 -0700
                Re: polyForth multitasker question hughaguilar96@gmail.com - 2017-04-15 17:26 -0700
                Re: polyForth multitasker question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-16 09:10 -0500
                Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-16 09:13 -1000
                Re: polyForth multitasker question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-16 16:28 +0000
                Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-16 09:27 -1000
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-16 14:45 -0700
                Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-16 17:50 -1000
                Re: polyForth multitasker question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-17 12:13 +0000
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-17 13:27 -0700
                Re: polyForth multitasker question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-18 03:49 -0500
                Re: polyForth multitasker question Alex <alex@rivadpm.com> - 2017-04-18 13:47 +0100
                Re: polyForth multitasker question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-18 14:30 -0500
                Re: polyForth multitasker question hughaguilar96@gmail.com - 2017-04-16 20:58 -0700
                Re: polyForth multitasker question "HAA" <someone@microsoft.com> - 2017-04-18 11:47 +1000
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-17 19:19 -0700
                Re: polyForth multitasker question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-18 04:34 -0500
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-19 02:00 -0700
                Re: polyForth multitasker question "HAA" <someone@microsoft.com> - 2017-04-19 18:10 +1000
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-19 01:41 -0700
                Re: polyForth multitasker question "HAA" <someone@microsoft.com> - 2017-04-19 21:38 +1000
                Re: polyForth multitasker question Lars Brinkhoff <lars.spam@nocrew.org> - 2017-04-19 10:56 +0200
                Re: polyForth multitasker question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-19 07:22 -0500
                Re: polyForth multitasker question hughaguilar96@gmail.com - 2017-04-17 20:10 -0700
                Re: polyForth multitasker question stephen@mpeforth.com (Stephen Pelc) - 2017-04-18 09:35 +0000
                Re: polyForth multitasker question hughaguilar96@gmail.com - 2017-04-18 08:01 -0700
                Re: polyForth multitasker question Julian Fondren <julian.fondren@gmail.com> - 2017-04-18 09:03 -0700
                Re: polyForth multitasker question Cecil Bayona <cbayona@cbayona.com> - 2017-04-18 11:07 -0500
                Re: polyForth multitasker question Cecil Bayona <cbayona@cbayona.com> - 2017-04-18 10:59 -0500
                Re: polyForth multitasker question "HAA" <someone@microsoft.com> - 2017-04-19 19:13 +1000
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-15 17:36 -0700
                Re: polyForth multitasker question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-16 16:27 +0000
                Re: polyForth multitasker question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-16 04:32 -0500
                Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-14 10:15 -1000
                Re: polyForth multitasker question albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-15 13:07 +0200
                Re: polyForth multitasker question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-17 15:13 +0000
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-14 01:36 -0700
                Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-13 22:48 -1000
                Re: polyForth multitasker question rickman <gnuarm@gmail.com> - 2017-04-14 16:36 -0400
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-14 14:55 -0700
                Re: polyForth multitasker question hughaguilar96@gmail.com - 2017-04-14 15:27 -0700
                Re: polyForth multitasker question Alex <alex@rivadpm.com> - 2017-04-14 23:45 +0100
                Re: polyForth multitasker question hughaguilar96@gmail.com - 2017-04-16 21:13 -0700
                Re: polyForth multitasker question Alex <alex@rivadpm.com> - 2017-04-17 16:57 +0100
                Re: polyForth multitasker question hughaguilar96@gmail.com - 2017-04-17 20:08 -0700
                Re: polyForth multitasker question rickman <gnuarm@gmail.com> - 2017-04-14 20:29 -0400
                Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-14 15:34 -1000
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-14 19:43 -0700
                Re: polyForth multitasker question rickman <gnuarm@gmail.com> - 2017-04-14 23:03 -0400
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-14 23:50 -0700
                Re: polyForth multitasker question rickman <gnuarm@gmail.com> - 2017-04-15 03:55 -0400
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-15 01:38 -0700
                Re: polyForth multitasker question rickman <gnuarm@gmail.com> - 2017-04-15 11:50 -0400
                Re: polyForth multitasker question john <anon@example.com> - 2017-04-15 12:03 +0100
                Re: polyForth multitasker question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-15 12:41 +0000
                Re: polyForth multitasker question rickman <gnuarm@gmail.com> - 2017-04-15 12:14 -0400
                Re: polyForth multitasker question Paul Rubin <no.email@nospam.invalid> - 2017-04-15 17:32 -0700
                Re: polyForth multitasker question rickman <gnuarm@gmail.com> - 2017-04-15 20:41 -0400
                Re: polyForth multitasker question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-17 14:57 +0000
                Re: polyForth multitasker question hughaguilar96@gmail.com - 2017-04-14 20:45 -0700
                Re: polyForth multitasker question rickman <gnuarm@gmail.com> - 2017-04-14 23:56 -0400
                Re: polyForth multitasker question albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-15 14:32 +0200
                Re: polyForth multitasker question rickman <gnuarm@gmail.com> - 2017-04-15 12:05 -0400
                Re: polyForth multitasker question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-15 04:10 -0500
                Re: polyForth multitasker question foxaudioresearch@gmail.com - 2017-04-13 03:19 -0700
                Re: polyForth multitasker question Alex <alex@rivadpm.com> - 2017-04-13 15:46 +0100
                Re: polyForth multitasker question foxaudioresearch@gmail.com - 2017-04-14 11:37 -0700
                Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-13 09:48 -1000
                Re: polyForth multitasker question Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-13 05:37 -0500
                Re: polyForth multitasker question minforth@arcor.de - 2017-04-11 22:12 -0700
                Multitasking with Forth processors Lars Brinkhoff <lars.spam@nocrew.org> - 2017-04-12 07:39 +0200
                Re: Multitasking with Forth processors Paul Rubin <no.email@nospam.invalid> - 2017-04-11 22:58 -0700
                Re: Multitasking with Forth processors rickman <gnuarm@gmail.com> - 2017-04-12 03:00 -0400
                Re: Multitasking with Forth processors albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-12 12:18 +0200
                Re: Multitasking with Forth processors rickman <gnuarm@gmail.com> - 2017-04-12 17:11 -0400
                Re: Multitasking with Forth processors foxaudioresearch@gmail.com - 2017-04-12 13:50 -0700
                Re: Multitasking with Forth processors "Elizabeth D. Rather" <erather@forth.com> - 2017-04-12 13:30 -1000
                Re: Multitasking with Forth processors Jan Coombs <jenfhaomndgfwutc@murmic.plus.com> - 2017-04-14 12:20 +0100
                Re: Multitasking with Forth processors rickman <gnuarm@gmail.com> - 2017-04-14 16:47 -0400
            Re: polyForth multitasker question "Elizabeth D. Rather" <erather@forth.com> - 2017-04-10 07:42 -1000

csiph-web