dotnet / dotnet/dotnet-api-docs
GC.RegisterForFullGCNotification does not throw InvalidOperationException in concurrent mode
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
### Type of issue
Other (describe below)
### Description
>This member is not available when concurrent garbage collection is enabled. See the runtime setting for information about how to disable concurrent garbage collection.
[Managed code checks return value](https://source.dot.net/#System.Private.CoreLib/src/System/GC.CoreCLR.cs,461) but [runtime always return true](https://github.com/dotnet/runtime/blob/main/src/coreclr/gc/gc.cpp#L51748), so `InvalidOperationException` always not throw.
### Page URL
https://learn.microsoft.com/en-us/dotnet/api/system.gc.registerforfullgcnotification?view=net-9.0
### Content source URL
https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System/GC.xml
### Document Version Independent Id
d39ddff3-1f0c-8cd5-e0c9-8b4125fc7331
### Article author
@dotnet-bot
Contributor guide
Assessment
This issue has not been assessed yet.