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


Groups > comp.lang.forth > #26354

Re: Co-routines a la Knuth

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: Co-routines a la Knuth
Date 2013-10-08 15:05 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2013Oct8.170511@mips.complang.tuwien.ac.at> (permalink)
References <6b24531a-7c25-4a3e-9b60-21af2bb89dae@googlegroups.com> <2013Oct7.143349@mips.complang.tuwien.ac.at> <246dbc29-f2c7-4f90-a58a-abcdec4ae3bd@googlegroups.com>

Show all headers | View raw


m.a.m.hendrix@tue.nl writes:
>Yes, in the general case I thought of swapping all stackpointers, not
>only the instruction pointer, but I can indeed find an example where 
>the stacks must be separate. That makes CO look like PAUSE (i.e. 
>switching tasks). Interesting.

The two differences between a coroutine call and PAUSE are that

1) PAUSE switches to any ready task, a coroutine call to a specific
one (so I am not sure if CO is a good name; what if you want to have
more than two coroutines?).

2) In a coroutine call you may want to pass one or more data or FP
stack items to the other task.

- 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 2013: http://www.euroforth.org/ef13/

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


Thread

Co-routines a la Knuth mhx@iae.nl - 2013-10-05 11:50 -0700
  Re: Co-routines a la Knuth Paul Rubin <no.email@nospam.invalid> - 2013-10-05 14:15 -0700
    Re: Co-routines a la Knuth mhx@iae.nl - 2013-10-06 03:22 -0700
      Re: Co-routines a la Knuth mhx@iae.nl - 2013-10-06 09:58 -0700
  Re: Co-routines a la Knuth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-10-07 12:33 +0000
    Re: Co-routines a la Knuth m.a.m.hendrix@tue.nl - 2013-10-07 07:17 -0700
      Re: Co-routines a la Knuth mhx@iae.nl - 2013-10-07 13:43 -0700
        Re: Co-routines a la Knuth "Elizabeth D. Rather" <erather@forth.com> - 2013-10-07 12:58 -1000
          Re: Co-routines a la Knuth mhx@iae.nl - 2013-10-08 23:58 -0700
            Re: Co-routines a la Knuth "Elizabeth D. Rather" <erather@forth.com> - 2013-10-08 21:08 -1000
      Re: Co-routines a la Knuth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-10-08 15:05 +0000
        Re: Co-routines a la Knuth mhx@iae.nl - 2013-10-09 13:23 -0700

csiph-web