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

Task / ValueTask related guidance #230

Merged
merged 1 commit into from
Jan 31, 2022
Merged

Conversation

czimpi
Copy link
Contributor

@czimpi czimpi commented Jan 30, 2022

I found it somewhat misleading, that the deadlock example in 1835 is referencing ASP.NET, as this scenario was true for classical ASP.NET, but is not applicable for ASP.NET Core as explained by Stephen Cleary in this blog post. The title stating 'single-threaded environment' might also be somewhat confusing: Yes, this rule references special environments with their SynchronizationContext forcing a push-back of the continuation to a special dedicated context (rather than tacking a thread from the thread pool to continue with), but it still might be confusing, as it is possible to create multiple Tasks / Threads within e.g. WPF, so 'single-threaded' might not be the best wording.

I also created a new rule 1840, to explain the fallacies when using ValueTask / ValueTask<T> and advising to either directly await these special types or using .AsTask() to retrieve a Task / Task<T>.

@dennisdoomen
Copy link
Owner

Those are very good suggestions. Thanks for that.

@dennisdoomen dennisdoomen merged commit 4ad2ebe into dennisdoomen:master Jan 31, 2022
@bkoelman bkoelman mentioned this pull request Feb 1, 2022
@czimpi
Copy link
Contributor Author

czimpi commented Feb 1, 2022

The generic version of the ValueTask (ValueTask<T>) is not shown in the header (but within the description) on the website, but unfortunately I don't know how to mask it regarding the used build system.

@dennisdoomen
Copy link
Owner

The generic version of the ValueTask (ValueTask<T>) is not shown in the header (but within the description) on the website, but unfortunately I don't know how to mask it regarding the used build system.

Sorry, but I don't get your problem.

@czimpi
Copy link
Contributor Author

czimpi commented Feb 2, 2022

image

@bkoelman
Copy link
Contributor

bkoelman commented Feb 2, 2022

The generic version of the ValueTask (ValueTask) is not shown in the header (but within the description) on the website, but unfortunately I don't know how to mask it regarding the used build system.

Probably related to #209.

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