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

Fix deprecations: use atomicOp in examples/bench-http-request #2060

Merged
merged 1 commit into from
Feb 16, 2018

Conversation

wilzbach
Copy link
Member

@wilzbach wilzbach commented Feb 5, 2018

Yet another deprecation removed.
Note that std.getopt doesn't support shared.

See also: dlang/dmd#7816

readOption("k", &g_maxKeepAliveRequests, "Maximum number of keep-alive requests for each connection");
readOption("c", cast(long*) &g_concurrency, "The maximum number of concurrent requests");
readOption("d", cast(long*) &g_requestDelay, "Artificial request delay in milliseconds");
readOption("k", cast(long*) &g_maxKeepAliveRequests, "Maximum number of keep-alive requests for each connection");
Copy link
Contributor

Choose a reason for hiding this comment

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

A better design would be to make those variables immutable and to set them from a shared static constructor.

Copy link
Member Author

Choose a reason for hiding this comment

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

but that would require duplicating these three variables, wouldn't it?
(then I could use atomicStore as well)

@wilzbach wilzbach changed the title Fix deprecations: use atomcOp in examples/bench-http-request Fix deprecations: use atomicOp in examples/bench-http-request Feb 5, 2018
@s-ludwig
Copy link
Member

Agree that immutable would generally be nicer. Another possibility would be to pass the values as arguments to runWorkerTask to the distTask function. But since this is just an incremental improvement, I would merge this as-is and tackle that in a separate PR (there is probably more that could be refactored in that example).

@s-ludwig s-ludwig merged commit b9901f7 into vibe-d:master Feb 16, 2018
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.

3 participants