The main idea of the video is illustrating timing issues (undefined behavior related to sequence of operations) that can arise from lock contention on a resource. The example above goes to great lengths to ensure that sequences of operations that have to be in the correct order (for animation, eg) need to hold the lock and perform them all before releasing them. And key frames or separate sequences can afford to get into lock contention knowing that inside of the time period that the lock is held, that the order of operations will be respected.
For comments and feedback please use these:
Issue: https://github.com/nazmulidris/rust-s...
Repo (at SHA b1d319b): https://github.com/r3bl-org/r3bl-open...
Issues: https://github.com/nazmulidris/rust-s...
References:
https://doc.rust-lang.org/std/macro.p...
https://github.com/nazmulidris/rust-s...
Chapters:
00:00:00 Intro
00:02:00 Animation primer
00:03:00 Demo of desired behavior
00:05:30 readline() is blocking
00:06:30 Full TUI - Partial TUI - CLI
00:07:40 println!(), stdout(), lock()
00:09:30 Undefined behavior wrt timing or sequence of output
00:10:30 How to deal with lock acqusition on spinner animation
00:11:15 git worktree primer
00:14:30 Start vscode
00:17:30 Demo undefined behavior of output sequence and timing
00:20:30 Fix the code
00:45:30 Run the changes to see if it works
00:48:30 ctrl_c handling code review
01:00:30 ctrl_c handling with spinner code review
01:10:30 Outro