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


Groups > comp.lang.forth > #56955

Re: Why does the location of PAD move around?

From "HAA" <someone@microsoft.com>
Newsgroups comp.lang.forth
Subject Re: Why does the location of PAD move around?
Date 2017-04-10 10:31 +1000
Organization Aioe.org NNTP Server
Message-ID <ocejqb$1clq$1@gioia.aioe.org> (permalink)
References <20170401210719.376d37f4@_><1fOdnVjc191fXX3FnZ2dnUU7-YfNnZ2d@supernews.com><87o9we5mc8.fsf@nightsong.com><0719e78c-1196-4465-b0a6-a604f3f73b96@googlegroups.com><87h9265los.fsf@nightsong.com> <oc1h4a$1t9c$1@gioia.aioe.org><87vaqi9vn8.fsf@nightsong.com> <oc74ge$13r3$1@gioia.aioe.org><oc7g1i$laa$1@dont-email.me> <oc9amm$1oja$1@gioia.aioe.org> <ocai59$ldc$1@dont-email.me>

Show all headers | View raw


Alex wrote:
> On 4/8/2017 01:25, HAA wrote:
> > Alex wrote:
> >> On 4/7/2017 05:26, HAA wrote:
> >>> Paul Rubin wrote:
> >>>> "HAA" <someone@microsoft.com> writes:
> >>> ...
> >>> IMO the mechanism used by Forth Inc (and consequently L&P) to
> >>> switch tasks is more complicated than it needs to be.  Executing
> >>> instructions in user variables, splitting PAUSE into two fragments,
> >>> seems a lot of effort when all that's needed is a tight loop that tests
> >>> a flag e.g.
> >>>
> >>>       begin
> >>>          mov  bx, [bx+cell]    \ point to STATUS of next task
> >>>          cmp  [bx], 0             \ is task active?
> >>>       0<> until
> >>>
> >>> The original method is cute - but justified?
> >>>
> >>>
> >>>
> >>
> >> This burns CPU, which might be OK in a standalone environment; but even
> >> there, it is incredibly wasteful of power. Polling will not work
> >> satisfactorily in many hosted environments; for example, running on an
> >> operating system like Linux or Windows.
> >
> > A round-robin with no active tasks, or a Linux/Windows with no event to drive
> > them, means burning CPU.  You're only option in that case is to wind down
> > power consumption.
> >
>
> That's not how Linux or Windows works or any half decent scheduler of my
> experience. As long as the processor has (1) a HALT or equivalent
> instruction and (2) can resume from the halt in response to external
> interrupts, there is no need to spin on the spot.* In Windows this is
> managed by the system idle task. The OS should always be asked to wait
> on an event on your behalf.
>
> *There are some spin locks required in multi processor systems, but
> we're now way off the reservation.

Let's get back to your complaint above that my task switching code 'burns
CPU'.  Well so does every Forth round-robin tasker I've seen.  If you believe
my code represents a backward step, please explain in what way.




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


Thread

Why does the location of PAD move around? Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> - 2017-04-01 21:07 -0400
  Re: Why does the location of PAD move around? hughaguilar96@gmail.com - 2017-04-01 19:32 -0700
    Re: Why does the location of PAD move around? Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> - 2017-04-02 02:00 -0400
      Re: Why does the location of PAD move around? Julian Fondren <julian.fondren@gmail.com> - 2017-04-01 23:51 -0700
        Re: Why does the location of PAD move around? "Elizabeth D. Rather" <erather@forth.com> - 2017-04-01 21:59 -1000
        Re: Why does the location of PAD move around? krishna.myneni@ccreweb.org - 2017-04-09 09:54 -0700
  Re: Why does the location of PAD move around? Julian Fondren <julian.fondren@gmail.com> - 2017-04-01 20:10 -0700
    Re: Why does the location of PAD move around? "Elizabeth D. Rather" <erather@forth.com> - 2017-04-01 18:39 -1000
    Re: Why does the location of PAD move around? Mark Wills <markwills1970@gmail.com> - 2017-04-02 08:29 -0700
  Re: Why does the location of PAD move around? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-02 04:13 -0500
    Re: Why does the location of PAD move around? Paul Rubin <no.email@nospam.invalid> - 2017-04-02 18:08 -0700
      Re: Why does the location of PAD move around? Julian Fondren <julian.fondren@gmail.com> - 2017-04-02 18:13 -0700
        Re: Why does the location of PAD move around? Paul Rubin <no.email@nospam.invalid> - 2017-04-02 18:22 -0700
          Re: Why does the location of PAD move around? Julian Fondren <julian.fondren@gmail.com> - 2017-04-02 18:31 -0700
          Re: Why does the location of PAD move around? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-03 04:37 +0200
            Re: Why does the location of PAD move around? Paul Rubin <no.email@nospam.invalid> - 2017-04-02 22:04 -0700
              Re: Why does the location of PAD move around? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-04 13:47 +0200
                Re: Why does the location of PAD move around? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-04 10:53 -0500
                Re: Why does the location of PAD move around? Alex <alex@rivadpm.com> - 2017-04-04 17:04 +0100
                Re: Why does the location of PAD move around? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-04 19:00 +0200
                Re: Why does the location of PAD move around? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-05 03:39 -0500
                Re: Why does the location of PAD move around? Alex <alex@rivadpm.com> - 2017-04-05 19:17 +0100
            Re: Why does the location of PAD move around? "Elizabeth D. Rather" <erather@forth.com> - 2017-04-02 21:44 -1000
          Re: Why does the location of PAD move around? "Elizabeth D. Rather" <erather@forth.com> - 2017-04-02 21:35 -1000
          Re: Why does the location of PAD move around? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-03 03:38 -0500
          Re: Why does the location of PAD move around? "HAA" <someone@microsoft.com> - 2017-04-05 11:25 +1000
            Re: Why does the location of PAD move around? Paul Rubin <no.email@nospam.invalid> - 2017-04-05 18:23 -0700
              Re: Why does the location of PAD move around? "HAA" <someone@microsoft.com> - 2017-04-07 14:26 +1000
                Re: Why does the location of PAD move around? Alex <alex@rivadpm.com> - 2017-04-07 08:47 +0100
                Re: Why does the location of PAD move around? "HAA" <someone@microsoft.com> - 2017-04-08 10:25 +1000
                Re: Why does the location of PAD move around? Paul Rubin <no.email@nospam.invalid> - 2017-04-07 20:37 -0700
                Re: Why does the location of PAD move around? Alex <alex@rivadpm.com> - 2017-04-08 12:42 +0100
                Re: Why does the location of PAD move around? jason.songhurst@gmail.com - 2017-04-08 20:28 -0700
                Re: Why does the location of PAD move around? Coos Haak <htrofhc@gmail.com> - 2017-04-09 13:47 +0200
                Re: Why does the location of PAD move around? "Elizabeth D. Rather" <erather@forth.com> - 2017-04-09 08:36 -1000
                Re: Why does the location of PAD move around? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-09 14:48 +0200
                Re: Why does the location of PAD move around? "HAA" <someone@microsoft.com> - 2017-04-10 10:31 +1000
                Re: Why does the location of PAD move around? Alex <alex@rivadpm.com> - 2017-04-10 09:29 +0100
                Re: Why does the location of PAD move around? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-10 11:57 +0200
      Re: Why does the location of PAD move around? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-03 03:43 +0200
        Re: Why does the location of PAD move around? "Elizabeth D. Rather" <erather@forth.com> - 2017-04-02 21:53 -1000
  Re: Why does the location of PAD move around? "HAA" <someone@microsoft.com> - 2017-04-02 21:31 +1000
    Re: Why does the location of PAD move around? Coos Haak <htrofhc@gmail.com> - 2017-04-02 15:12 +0200
      Re: Why does the location of PAD move around? "HAA" <someone@microsoft.com> - 2017-04-03 10:46 +1000
        Re: Why does the location of PAD move around? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-03 03:31 +0200
          Re: Why does the location of PAD move around? hughaguilar96@gmail.com - 2017-04-02 19:14 -0700
        Re: Why does the location of PAD move around? "Elizabeth D. Rather" <erather@forth.com> - 2017-04-02 21:55 -1000
          Re: Why does the location of PAD move around? "HAA" <someone@microsoft.com> - 2017-04-04 11:06 +1000
            Re: Why does the location of PAD move around? Alex <alex@rivadpm.com> - 2017-04-04 12:54 +0100
              Re: Why does the location of PAD move around? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-04 16:27 +0000
                Re: Why does the location of PAD move around? Alex <alex@rivadpm.com> - 2017-04-04 19:23 +0100
          Re: Why does the location of PAD move around? hughaguilar96@gmail.com - 2017-04-07 22:04 -0700
    Re: Why does the location of PAD move around? hughaguilar96@gmail.com - 2017-04-02 14:21 -0700
  Why does the location of PAD move around? Mark Wills <markwills1970@gmail.com> - 2017-04-02 08:28 -0700
    Re: Why does the location of PAD move around? hughaguilar96@gmail.com - 2017-04-02 13:47 -0700
      Re: Why does the location of PAD move around? hughaguilar96@gmail.com - 2017-04-02 15:13 -0700
        Re: Why does the location of PAD move around? hughaguilar96@gmail.com - 2017-04-02 18:55 -0700

csiph-web