dotnet / dotnet/dotnet-api-docs

Mixing Tasks and Threads

Open
#926 1 comment 0 reactions 0 assignees View on GitHub
area-System.Threading dotnet-api/prod Pri2
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

This docs mix tasks with threads. A task is not a thread ! 2 different tasks can run in the same thread. It's the TaskScheduler job to determines which Task runs on which thread. Thus this documentation is very confusing. SemaphoreSlim does not lock access to a thread. It locks access to a resource. Which can be of any kind!

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: e1be1dd3-b825-9f35-eafb-8904eca9f9d7
* Version Independent ID: 92f24f67-5b11-f1d1-a8cc-b8bf8fbe7ddc
* Content: [SemaphoreSlim Class (System.Threading)](https://docs.microsoft.com/en-us/dotnet/api/system.threading.semaphoreslim?redirectedfrom=MSDN&view=netframework-4.7.2)
* Content Source: [xml/System.Threading/SemaphoreSlim.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Threading/SemaphoreSlim.xml)
* Product: **dotnet-api**
* GitHub Login: @rpetrusha
* Microsoft Alias: **ronpet**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.