Closed rvjansen closed 6 months ago
Hi René,
for 'protecting' blocks RxInterpreter.nrx calls runprotected, which calls runfree, which then calls runprotected etc. This obviously overflows the stack when called too much. Changing the Java stack size will make it to 100000 loops;
But there's a different issue with smaller loops : loop protect Race.lock for 4
Still trying to understand the code, but it seems something needs to be fixed..
Marc
In the original Java example the class is static; could not do that in NetRexx. In NetRexx you can only make classes static by having every method static, but in the case or f run() it loses the right signature for the runnable interface that way. I wonder what we need to do with that.
fixed with commit 2e9ae103caa7dd24bf7505e655e0b32dd44c0c26 Defuse the lock at tne END statement of the protected block
works; all testing succeeds.
The following program only fails with the "loop protect Race.lock" included; without it, or compiled, it works OK. (Without the protect it obviously gives incorrect output, but that was the point of this educational program, which was made to simplify and illustrate a real race condition at work).
fails when executed interpreted; with AOT compiler everything is fine and working as expected. These messages are issued: