Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate initialization delay #75

Merged

Conversation

kdnilsen
Copy link
Contributor

Automatically calculate the initialization delay rather than requiring users to guess and specify. The original InitializationDelay command-line argument is still supported for compatibility with existing scripts, but the value is ignored.

Additionally, fix up a few comments and remove dependencies on deprecated new Long() constructor.

kdnilsen added 2 commits July 30, 2024 14:10
In the new code, we delay until initialization completes, and then add
some ms to account for time required to start() all threads.

Also, remove dependency on deprecated new Long() constructor.

And add some comments to explain handling of ms time unit.
@earthling-amzn
Copy link
Contributor

Is there any notion of initialization time out now? or will it just take as long as it takes?

@kdnilsen
Copy link
Contributor Author

There is no enforcement of a timeout on initialization. After almost all of the shared data structures and Threads are allocated, we check the current time. We have not yet started the customer or server threads. We "assume" it will take 4 ms per thread to start them all up. (measurements showed it takes approximately 2 ms per thread on my cloud desktop). We set the simulation start time to the current time plus the anticipated time to startup all threads.

If it takes longer than our assumed 4 ms per thread, we'll issue a warning message, but will not abort the simulation.

@@ -183,11 +181,11 @@ void initialize(ExtrememThread t) {
2 * Util.SizeOfFloat + 2 * Util.SizeOfBoolean);

// Account for 11 reference fields: args, dictionary,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Account for 10 ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Thanks. Fixed.

@kdnilsen
Copy link
Contributor Author

/integrate

@earthling-amzn earthling-amzn merged commit 7750c6a into corretto:master Jul 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants