0x2c7 / ruby_jard

Just Another Ruby Debugger. Provide a rich Terminal UI that visualizes everything your need, navigates your program with pleasure, stops at matter places only, reduces manual and mental efforts. You can now focus on real debugging.
https://rubyjard.org/
MIT License
845 stars 28 forks source link

Simplify threading model in REPL proxy #74

Closed 0x2c7 closed 4 years ago

0x2c7 commented 4 years ago

Recently, the dance between REPL threads is kinda complicated than it needs. There used to be 4 threads involve: 1 thread for Pry REPL loop, 1 thread for flushing output from REPL, 1 thread for listening to keyboard, and the stopping thread to sleep, and control states. It's a flawed solution, as the input in REPL loop is evaluated in another thread other from the stopping thread. It leads to many unexpected behaviors, like errors when accessing thread-local variables. It's time to standardize, and evaluation to the stopping thread instead.

Screenshot from 2020-10-13 14-56-35

Fix https://github.com/nguyenquangminh0711/ruby_jard/issues/73