rspec/rules/S2551/why-dotnet.adoc
kevin.hinz 7bb601b5d7
Modify rule S2551: clarify example used in the description (#3713)
* Modify rule S2551: clarify example in description

* Modify rule S2551: improve word choice
2024-03-15 14:40:37 +01:00

6 lines
748 B
Plaintext

== Why is this an issue?
A shared resource refers to a resource or data that can be accessed or modified by multiple https://en.wikipedia.org/wiki/Thread_(computing)[threads] or concurrent parts of a program. It could be any piece of data, object, file, database connection, or system resource that needs to be accessed or manipulated by multiple parts of a program at the same time.
Shared resources should not be used for https://en.wikipedia.org/wiki/Lock_(computer_science)[locking] because it increases the chance of https://en.wikipedia.org/wiki/Deadlock[deadlocks]. Any other thread could acquire (or attempt to acquire) the same lock while doing some operation, without knowing that the resource is meant to be used for locking purposes.