[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gforth-0.7.9_20211125 tasker.fs broken

From: Tomas Hlavaty
Subject: Re: gforth-0.7.9_20211125 tasker.fs broken
Date: Thu, 02 Dec 2021 00:10:24 +0100

Hi Bernd,

On Tue 30 Nov 2021 at 23:14, Bernd Paysan <bernd.paysan@gmx.de> wrote:
> Ok, seems to be a victim of the section code. Fixed in git head.

thanks for the fix and such quick response!

> Preferred multitasker is unix/pthread.fs in the new Gforth.

I have tested HEAD and it works.

This is the test program /tmp/task1.fs:

require ~/sw/gforth/tasker.fs
: counter create , does> dup 2 swap +! @ ;
0 counter v1
1 counter v2
: task: $1000 newtask constant ;
task: t1
task: t2
: t1& t1 activate begin pause v1 . 3000 ms again ;
: t2& t2 activate begin pause v2 . 5000 ms again ;

Run like this:

~/sw/gforth$ ./gforth -e -status -e 'include /tmp/task1.fs'

A few observations:

1) tasker.fs consumes 100% CPU.  Is it necessary?  Or could it be
   somehow reduced?

2) I had to run ./BUILD-FROM-SCRATCH twice in order to get everything

3) I need to use full path for require even though I start gforth from
   the gforth directory.  Is there a way to avoid absolute paths when
   the forth script is in a different directory?  (I did not run sudo
   make install and use gforth from the gforth directory directly.)

4) In order to build gforth, ./install-deps.sh downloads about 0.5GB

5) unix/pthread.fs works well.  Why does gforth prefer pthread

Thank you


reply via email to

[Prev in Thread] Current Thread [Next in Thread]