Part two of the refterm live stream is now available on YouTube - "Slow Code Isolation":https://youtu.be/lStYLF6Us_Q
-
-
Replying to @cmuratori
[1/2] Dumb question: Is the buffer locked? As far as I can see, a circular buffer can be completely thread-safe, while only locking writes during reads (or writes if there are multiple writers) if you can begin a write and bump the tail as an atomic action.
2 replies 0 retweets 0 likes -
Replying to @Benjipede
In keeping with the "this program is not optimized" statement of refterm, there are no threads in refterm! So the buffer doesn't have to be locked.
1 reply 0 retweets 0 likes -
Replying to @cmuratori @Benjipede
In general, unless you bypassed the kernel or maybe did a complete conhost implementation, etc., I'm not sure a terminal program on Windows can receive data fast enough to warrant using multiple threads :( I wish it weren't so, but, that seems to be the state of it.
1 reply 0 retweets 0 likes -
Replying to @cmuratori
[1/*] Thanks. So you ask for Windows to write to the buffer at certain points rather than having Windows just write, when it wants?
2 replies 0 retweets 0 likes -
Replying to @Benjipede
Yes. The reason for this is that the terminal frame rate is absurdly high. 7000fps was an actual number that it was hitting on a not-particularly-powerful machine. So there is no need to overlap processing of the frame with receiving input.
1 reply 0 retweets 0 likes -
Replying to @cmuratori @Benjipede
At most you are costing an extra 1/7000th of a second of latency, which no one will notice :) If the frame time were expensive, then you would want to consider overlapping the frame production with read delivery.
1 reply 0 retweets 0 likes
However, even in that case, it is not clear you would ever need to lock, because it should be fairly straightforward to do as you say: steer clear of the tail. Just ask Windows to write 1/2 the buffer while you look at the other half, etc.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.