Open
Conversation
Previously nodes could start and stop themselves and even all other nodes. Additionally, the local timestamp of every node was publicly visible (but even after this change it's unfortunately still accessible from other nodes of the same class, which cannot be prevented using Java method visibilities).
Even if logging using log4j was disabled, it was still loaded when initializing the simulator, which would fail and cause an exception if no log4j library could be found
And some minor cleanup
… optional The previous static methods to create a "default" simulator have been replaced by a simpler constructor for a simulator without tracing. If applications want to use the tracing feature, they will need to specify all required parameters. The "orderedTracing" parameter has been removed since it did nothing anyway. Tracing of messages is now optional and can be controlled by a new constructor parameter. Disabling it might be useful for improving performance or if applications want to print their own status messages instead.
Instead of always printing them to System.err
By sleeping a random duration (up to a configurable upper bound) before returning the next message
Instead of seconds, to enable more precise control and be more consistent with other blocking operations from the Java libraries (sleep, wait, ...)
Makes debugging and analyzing thread dumps a lot easier
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Most importantly: