dotnet / dotnet/dotnet-api-docs

default spin count not specified for constructors that don't explicitly set it

Đang mở
#809 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
.net/prod area-System.Threading Pri2 untriaged
Ngôn ngữ chính
C#
Star
949
Fork
1.7k
Merge trung bình
2 ngày 19 giờ
Pull request đã merge (30 ngày)
52

Mô tả

There are three constructors for ManualResetEventSlim. Two don't specify the spin count, while one does. The class is supposed to spin for some amount of time before falling back to a normal wait handle wait. The problem is, I have no clue what the default spin count is, if I don't specify it. By putting in a value, I don't know if I'm speeding it up or slowing it down. The documentation would be better if it could say, "Calling the parameterless constructor makes a new ManualResetEventSlim with a spin count of 10," or if a specific amount isn't something you want to publicly commit to, at least a general idea of what the number is set to, or some hints about the rules that are used to make the decision. Because I don't know what the default is, it's harder to make a decision about which constructor I ought to be using. I suppose my only fallback option is to create it and check the SpinCount property.

---
#### Document Details

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

* ID: 094c5713-5b4f-8928-2f63-d6ea692baf27
* Version Independent ID: 0bf6da8d-78a1-9ada-46f7-7e8bc8ae8146
* Content: [ManualResetEventSlim Constructor (System.Threading)](https://docs.microsoft.com/en-us/dotnet/api/system.threading.manualreseteventslim.-ctor?view=netframework-4.7.2#System_Threading_ManualResetEventSlim__ctor)
* Content Source: [xml/System.Threading/ManualResetEventSlim.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Threading/ManualResetEventSlim.xml)
* Product: **.net**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với xml/System.Threading/ManualResetEventSlim.xml và xem xét các mục cho cả ba hàm tạo, cùng với tài liệu của thuộc tính SpinCount. Xác nhận hành vi mặc định nào có thể được ghi lại cho các hàm tạo không tham số, sau đó cập nhật văn bản về các hàm tạo để người dùng có thể chọn một overload với sự hiểu rõ về hành vi spin-count của nó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
csharp
Lĩnh vực
documentation
Loại issue
Tài liệu
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.