[4.0 -> main] Use is_write_window in eos-vm-oc main to determine if it is safe to update code cache #962
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Merge #960
Resolve #951.
We used to use
is_main_thread
to determine if it was safe to update eos-vm-cc code cache, as a transaction on the main thread did not run in parallel with read-only threads. Now a read-only transaction on the main thread can run in parallel with read-only threads. It is not safe for a read-only transaction on the main thread to modify code cache data structures. The solution is to use app's execution window. When in write window, all transactions are executed sequentially and no read-only threads are executing transactions.