Tasking problem

Andrew Holt <[email protected]>
Newsgroups gmane.comp.lang.forth.gforth
Message-ID <CA+W02aTn01Z=RCkWF-tbErsGYNcPcUkhcA4D4Q6Fc0iZOo3A9Q@mail.gmail.com>
Hi,

I have just built the current git version of gforth (Gforth 0.7.9_20191107)
and tun a simple tasker test.

I get the following error message:

in file included from *the terminal*:0:-94575174554671:
in file included from *the terminal*:-1:1:
in file included from /tmp/tasks.fth:2:9:
/usr/local/share/gforth/0.7.9_20191107/tasker.fs:61:18: error: Undefined
word
    dup r@ user' >>>normal-dp<<< + dup >r !
Backtrace:
kernel/int.fs:534:33                     0 $7F223757F4C8 throw
kernel/int.fs:538:59                     1 $7F223757F588 '-error
kernel/int.fs:544:5                      2 $7F223757F5C8 (')
/usr/local/share/gforth/0.7.9_20191107/tasker.fs:48:12  3 $7F22375FCA30 '

It looks like I need to include something else in my simple test (BTW this
woks in the release on ubuntu):

require tasker.fs

variable cnt1
variable cnt2
-1 value t1
-1 value t2

0 cnt1 !
0 cnt2 !

: delay ( n -- )
    0 do 1 ms pause loop
;

: task1 ( str len -- )
  100 NewTask dup to t1
  0 swap pass
  begin
        ." task1:" cr
        10 delay
        1 cnt1 +!
        pause
  again
;

: task2 ( str len )
  100 NewTask dup to t2
  0 swap pass
    begin
        ." task2:"
        cnt1 @ . cr
        pause
    again
;

: main
    s" task1" task1
    s" task2" task2
    begin
        pause
        single-tasking?
    until
;

\ main


Any tips ?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.