C#


CSHARP.CONCURRENCY.LOCK.SCTB : Synchronous Call to Thread Body (C#)

Summary

The body of a thread is called synchronously.

Concurrency is an important but complex aspect of modern software. As a consequence, it is often used in an incorrect way, also because the subtleties of the C# memory model are not always understood. This checker identifies a large class of common programming errors due to incorrect uses of concurrency primitives, such as incorrect implementations of the singleton pattern and incorrect uses of the volatile field modifier, whose goal is to publish a field update to all executing cores. The latter, however, has a cost in terms of execution time.

Properties

Class Name Synchronous Call to Thread Body (C#)
Significance reliability
Mnemonic CSHARP.CONCURRENCY.LOCK.SCTB
Categories
CWE CWE:572 Call to Thread run() instead of start()
Availability Available for C# only.
Enabling Checks for this warning class are enabled by default. To disable them, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += discard class="Synchronous Call to Thread Body (C#)"

Resolution

Check if the warnings correspond to actual possible errors for a concurrent execution of the program.

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.