robhagemans / pcbasic

PC-BASIC - A free, cross-platform emulator for the GW-BASIC family of interpreters
http://www.pc-basic.org
Other
396 stars 48 forks source link

tight WHILE : WEND loops can lock up interpreter #130

Closed incanus closed 2 years ago

incanus commented 3 years ago

Bug report

Problem

If you have a very lightweight task in a WHILE : WEND loop, you can lock up the interpreter.

Program

10 WHILE 1
20 PALETTE 0,X
30 X=X+1 : IF X>15 THEN X=0
40 WEND

In PC-BASIC, this locks things up with no visual change. In GW-BASIC, it attempts to give you a seizure 😉

Notes

Perhaps Python is optimizing something out? Haven't investigate too deeply.

PC-BASIC version: 2.0.3 Operating system version: macOS 11.0.1

robhagemans commented 3 years ago

I suspect this is due to the video thread not keeping up with the BASIC thread - for some functions (such as INKEY$) there is an explicit sync on the BASIC thread, we may need something similar for PALETTE.

robhagemans commented 2 years ago

Fixed on develop by commit cf7897d11, thanks @incanus for reporting!