INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 9, ISSUE 02, FEBRUARY 2020 ISSN 2277-8616
452
IJSTR©2020
www.ijstr.org
Data Race Detection Techniques In Java: A
Comparative Study
Devesh Lowe, Dr. Mithilesh Kumar Dubey, Bhavna Galhotra
Abstract: Most modern programming languages support multi -threading, which is commonly required in executing parallel programs in mobile multi -
media applications, web-servers and operating systems. Concurrency bugs are common in multi-threaded applications. Bugs like race conditions, data
races and deadlocks are some problems which arise out of unsynchronized code but have to capacity to sneak in to large and complex structures and
may result in giving unexpected results. Data Race is one such synchronization bug, arising out of unsynchronized code, which can stay hidden even
after many rounds of testing, but can emerge as a system destroyer when it surfaces. Researchers, in last four decades have presented various tools to
detect data races which are broadly classified into static, dynamic and hybrid categories. In this paper authors have focussed on data races arising in
object oriented programming language- java and have presented a study of various research articles subjected towards early detection of data races.
Authors hereby present a study of techniques used by different researchers and have tried to summarise the java oriented approaches to solve the
problem. Authors also present a comparison on different java based tools used for data race detection.
Index Terms:Parallel Processing, Concurrency Bug, Race Condition, Dynamic Data Race Detection, Java
——————————
——————————
1. INTRODUCTION
Multi-threaded programs are the main stay of modern
programming. Most modern programming languages
support multithreaded applications, which definitely
improves the responsiveness of programs. Use of multi-
threaded applications give rise to concurrency bugs like
race conditions, data races and deadlocks. Data race is one
of the most common concurrency bug that is affecting
multithreaded programming since its inception. A data race
arises when two or more threads try to access a shared
resource and one of them is in write mode [1] i.e. trying to
change or update the shared resource. Data race is
notoriously difficult to
detect as ordering of thread execution is decided by
operating system where program or programmer don’t get
any access. A data race if not handled properly has the
potential to even crash a system. All parallel programming
languages provide mechanisms which help to prevent data
races. It is important that a data race caused by an
imperfect code must be detected early to prevent them from
causing much harm to the system.
In many situations, data races and race conditions are often
mistaken for each other. There is a peculiar causal and non-
causal relationship between Race Conditions and Data
Races. Many race conditions are caused by data races and
similarly many data races are caused by race conditions.
There are also situations where data races are independent
of race conditions and vice-versa. Race Condition occurs
when timing or ordering of events gets affects by other
undesirable or uncontrollable events resulting in hampered
programs correctness. For example situations created by
context switch, OS signals, hardware interrupts and
memory operations on multi-processors can produce race
conditions. Data race is more of a programming error of
synchronization. As explained by Sebastian Burckhardt at
Microsoft Research, Data Race happens when there are
two memory accesses in a program where both: [2]
Target the same location
Are performed concurrently by two threads
Are not reads
Are not synchronization operations
Various data race detection techniques have been
developed in last four decades which have been
instrumental in early detection of this anomaly. Researchers
have categorised these detection techniques as on-the-fly,
ahead of time and post mortem techniques [3]. Broadly
classified as Static and Dynamic techniques. Static data
race detection techniques or ahead of time techniques use
compile time heuristics. On-the-fly approaches are dynamic
in nature. Considering the frequency of occurrences of data
races in a multi-threaded application, most studies have
focused upon dynamic detection of data races keeping a
check over the number of false positives as minimum. We
observed that race detectors or tools developed by various
researchers were primarily enhancements over previously
written tools with an attempt to minimize false positives.
Since data races are more frequent in multi -threaded
————————————————
Devesh Lowe is currently pursuing Phd and is an assistant
professor, Jagan Institute of Management Studies, Rohini, New
Delhi, India, 110085,devesh.lowe@jimsindia.org
Mithilesh Kumar is an Associate Professor, Lovely Professional
University Punjab, India, mithilesh.21436@lpu.co.in
Bhavna Galhotra is pursuing Phd and is an assistant professor,
Jagan Institute of Management Studies, Rohini, New Delhi, India,
110085, bhawna.galhotra@jimsindia.org