Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: REM cost reform

...

Starting and using background threads during class initialization can result in deadlock.

Rule

Severity

Likelihood

Remediation Cost

Detectable

Repairable

Priority

Level

TSM02-J

Low

Probable

Yes

High

No

P2

P4

L3

Automated Detection

ToolVersionCheckerDescription
CodeSonar
Parasoft Jtest
Include Page
CodeSonar
Parasoft_V
CodeSonar
Parasoft_V
FB
CERT.
MT_CORRECTNESS.SC_START_IN_CTOR
TSM02.CSTARTDo not call the "start" method of threads from inside a constructor
SonarQube
Include Page
SonarQube_V
SonarQube_V
S2693Threads should not be started in constructors
Constructor invokes Thread.start()Parasoft Jtest9.5TRS.CSTARTImplemented

Bibliography

[Bloch 2005b]

Chapter 8, "Lazy Initialization"

[Grand 2002]

Chapter 5, "Creational Patterns, Singleton"

Issue Tracking

Tasklist
Review List
Review List
||Completed||Priority||Locked||CreatedDate||CompletedDate||Assignee||Name||
|T|M|F|1269649993019|1269700561582|rcs_mgr|"Starting and using background threads during class initialization can result in class initialization cycles and deadlock. *For instance,* the main thread responsible for performing class initialization *may* block waiting for the background thread, which in turn will wait for the main thread to finish class initialization." ... see suggested words in bold...I am also generally unsure about the use of "can" vs. "may" because deadlocks are a "possibility" so perhaps "may" should be used?|

...


...