9,770 karma · joined October 13, 2012
I think you have this wrong, actions generally occur on button release, until that you can move the mouse cursor to a different target, tab to another control, use [ESC] to cancel, and so on. Typing, moving a slider with the cursor keys, and similar things that make use of key repetition while holding down the key are the exception to this.
How often does 10 appear in the code base? And is the value you are looking for even 10 or does only the UI show 10 points but in code it is defined as 200 twip?
Or are you talking about a scenario where a rogue writer essentially randomly modifies the shared data structure instead of using the designated write() function? Well, in that case all bets are obviously off.
Even if you have
while (true) { sharedData.writeWaitFree(randomData) }
all other threads will be able to continue. Whether the result will be of any value will depend on the use case.If, on the other hand, you mean that some threads will enter an infinite loop inside of a read or write operation, then you have a bug in your wait-free algorithm and all bets are off. But we would generally assume that the implementation is good and the erroneous behavior is external.
If the value changes frequently, it will get outdated quickly, but that has nothing to do with the synchronization mechanism used. And even if writes happen rarely, there is always a chance that the value you read will be outdated a nanosecond later.
A sequence lock is a blocking lock. If the writer dies between the two increment operations, then the readers will spin forever waiting for the counter to become even again.
Not even remotely true except that in both cases you change a number in some text file. If you do it in source code, you have to get the source code, you have to identify the correct line[s], you need a build environment, you might have to reinstall the new version after the build. And on top of this you want to involve a language model in this. The difference in complexity, effort, and resource consumption is orders of magnitude. And we are not even considering that you will have to go through this for each future version to keep your modification included. This is an insane way to change a font size.
What I really want to get at is the distinction between leaving the actual code untouched and just moving it a bit around - to other functions, other classes, other files - and having to change the code - from deduplicating to completely rewritting it.
- the code is essentially good but all is in one file, you split it up, lines of code stay the same
- the code is essentially good but lacks some structure, for a function that does five things directly, you extract the functionality into five functions and call them from the original function, lines of code goes very slightly up
But once the code is actually bad - code duplication, bad abstractions, inefficient language use, ... - I would generally expect the lines of code to significantly drop. What scenarios are there where the code is actually bad but refactoring does not reduce the lines of code? It is certainly possible but at moment I am having a hard time comming up with a good example.
- allow drawing wires backwards from sink to source
- allow connecting inputs
Also there is a problem with the tests and the simulator that showed up in the SR latch level. Despite having the correct circuit, the tests failed until I swapped the two NOR gates. I can not reproduce it, but I would guess it has something to do with the component placement order, the update order of the simulator, and how the tests are executed. As the NOR feedback loop has no well-defined initial state, it probably settled in a placement order dependent way that made the tests fail. Maybe Q was already 1 and the test looks for a 0 to 1 transition when enabling S?
The idea is amazing, making this work consistently requires effort, and a lot of it. And as only a few applications invested this effort, it only works with a few applications and never really took off outside of Microsoft. I think this used to work with WordPad and maybe even Notepad but it no longer does, you just get an image instead of the chart object in WordPad and nothing at all in Notepad. It is a dying technology.
[1] https://bsi-inc.com/sds_pdf/sds_un_cure.pdf