Your browser does not support JavaScript! Skip to main content
Free 30-day trial Customer portal Careers DO-178C Handbook
 
Rapita Systems
 

Industry leading verification tools & services

Rapita Verification Suite (RVS)

  RapiTest - Unit/system testing   RapiCover - Structural coverage analysis   RapiTime - Timing analysis (inc. WCET)   RapiTask - Scheduling visualization   RapiCoverZero - Zero footprint coverage analysis   RapiTimeZero - Zero footprint timing analysis   RapiTaskZero - Zero footprint scheduling analysis

Multicore verification

  MACH178   Multicore Timing Solution   RapiDaemons

Services

  V & V Services   Qualification   Training   Tool Integration  Support

Industries

  Aerospace (DO-178C)   Automotive (ISO 26262)   Space

Other

  RTBx   Mx-Suite   Software licensing   Product life cycle policy  RVS development roadmap

Latest from Rapita HQ

Latest news

RVS 3.18 Launched
Solid Sands partners with Rapita Systems
Danlaw Acquires Maspatechnologies - Expanding Rapita Systems to Spain
Rapita co-authored paper wins ERTS22 Best paper award
View News

Latest from the Rapita blog

Measuring response times and more with RapiTime
Why mitigating interference alone isn’t enough to verify timing performance for multicore DO-178C projects
There are how many sources of interference in a multicore system?
Supporting modern development methodologies for verification of safety-critical software
View Blog

Latest discovery pages

do178c DO-178C Guidance: Introduction to RTCA DO-178 certification
matlab_simulink MATLAB® Simulink® MCDC coverage and WCET analysis
code_coverage_ada Code coverage for Ada, C and C++
amc-20-193 AMC 20-193
View Discovery pages

Upcoming events

Aerospace Tech Week Europe 2023
2023-03-29
Aeromart Montreal 2023
2023-04-04
Certification Together International Conference
2023-05-10
View Events

Technical resources for industry professionals

Latest White papers

DO178C Handbook
Efficient Verification Through the DO-178C Life Cycle
A Commercial Solution for Safety-Critical Multicore Timing Analysis
Compliance with the Future Airborne Capability Environment (FACE) standard
View White papers

Latest Videos

Streamlined software verification with RVS 3.18
Sequence analysis with RapiTime
Visualize call dependencies with RVS thumbnail
Visualize call dependencies with RVS
Analyze code complexity thumbnail
Analyze code complexity with RVS
View Videos

Latest Case studies

Supporting ISO 26262 ASIL D software verification for EasyMile
RapiCover’s advanced features accelerate the certification of military UAV Engine Control
Front cover of whitepaper collins
Delivering world-class tool support to Collins Aerospace
View Case studies

Other Downloads

 Webinars

 Brochures

 Product briefs

 Technical notes

 Research projects

Discover Rapita

Who we are

The company menu

  • About us
  • Customers
  • Distributors
  • Locations
  • Partners
  • Research projects
  • Contact us

US office

+1 248-957-9801
info@rapitasystems.com
Rapita Systems, Inc.
41131 Vincenti Ct.
Novi
MI 48375
USA

UK office

+44 (0)1904 413945
info@rapitasystems.com
Rapita Systems Ltd.
Atlas House
Osbaldwick Link Road
York, YO10 3JB
UK

Spain office

+34 930 46 42 72
info@rapitasystems.com
Rapita Systems S.L.
Parc UPC, Edificio K2M
c/ Jordi Girona, 1-3, Office 306-307
Barcelona 08034
Spain

Working at Rapita

Careers

Careers menu

  • Current opportunities & application process
  • Working at Rapita
Back to Top

Race condition testing

Breadcrumb

  1. Home
  2. Blog
  3. Race condition testing
2019-11-20

Race conditions occur in multithreaded software when multiple threads attempt to modify a piece of shared data at the same time. This can become a potentially serious problem if the output of one thread’s execution affects another thread’s execution, in a way that causes unexpected or incorrect results.

Exposing potential race conditions is crucial because it shows you where you need to re-design your code to eliminate unexpected results. Certification authorities in the critical software industry are increasingly requesting that software developers demonstrate adequate testing for race conditions in their code.

The problem with race conditions

Whether or not a race condition occurs – and whether or not it results in errors – depends on the relative timing behaviors of the competing threads. In a non-deterministic system, these behaviors can be different for each run of the software.

In the example below, Threads 1 and 2 are accessing and modifying a global variable, ‘Y’. The behavior of the threads changes from one run to the next, but because each thread is able to complete without interruption, a correct (if different) value results each time.

Race Conditions

During the third run, however, the behavior changes again. Here, Thread 1 is interrupted before it completes, and Thread 2 modifies the global variable that Thread 1 used as its input. Now, when Thread 1 completes, it writes a value that is unexpected.

Multithreaded testing

Using RapiTest to test potential race conditions

RapiTest, and our powerful Spreadsheet Test Format, include features specifically designed to tackle the challenges that arise with testing non-deterministic systems. We’ve also designed customized integration libraries to optimize your integration for multithreaded testing, and a unique visualization tool that that helps you understand how your threads interact.

RapiTest helps you test potential race conditions in your code. Using RapiTest, you can:

  • Design and run a multithreaded test.
  • Identify potential race conditions.
  • Visualize the interactions between threads.

 

Design and run a multithreaded test

Our Spreadsheet Test Format is the perfect tool for writing multithreaded tests, as it lets you define complex behavior in an easily-readable way. It has several useful features including a Grouping Checks feature, and specific operators (e.g. ‘wait’, ‘kill’) that give you control over your threads’ behavior and execution.

Multi-threaded testing

These features allow you to define exactly when and how your threads run during testing, giving you the ’reproducibility’ you need to test them effectively.

Identify and analyze potential race conditions

When you run a multithreaded test with RapiTest, potential race conditions are highlighted in the results as failing asserts. You can drill down through each function to explore where and how these failures have occurred.

Once you know where to look, you can investigate and re-design your code to prevent race conditions from occurring, i.e. by adding mutual exclusions.

Visualize the interactions between threads

Threads diagram

Being able to visualize the behavior of your system is valuable, not only in terms of enhancing your own understanding of your code, but also being able to share that understanding, to collaborate with other developers and solve problems collectively.

Our products include powerful visualization features; for example, RapiTask includes an inbuilt viewer that shows high-level graphical views of your system’s runtime behavior, including across multiple cores.

Working with our customers, we’ve gone a step further and designed a unique tool for visualizing the interactions between threads in a multithreaded system.

The tool renders the call tree that occurs in each test run, with the threads displayed as different colours. Details of the function calls are recorded in each line, giving you a concise yet detailed overview of the progress of each thread, and the effects of context switching.

Implicit context switches are shown in grey, while forced context switches – i.e. those that you have defined in your test design – are shown in bright red.

Multicore race conditions

 

Viewing your tests in this way highlights expected and unexpected behavior, according to your understanding of the code. It’s also a simple way to identify potential issues and share these with colleagues.

The tool also allows you to take a step back, and view the behavior of different test runs side by side. From here, you can recognize problematic patterns, drill into the details, and work to address these in your code.

More about RapiTest

If you would like to find out more about the advanced features of RapiTest (including multithreaded testing) you can:

  • Download our RapiTest product brief
  • Watch our full RapiTest Demo video
  • Download a free trial of RVS
  • Visit the RapiTest product page
  • Contact us for a live demo of RapiTest

 

DO-178C webinars

DO178C webinars

White papers

DO178C Handbook Efficient Verification Through the DO-178C Life Cycle
A Commercial Solution for Safety-Critical Multicore Timing Analysis
Compliance with the Future Airborne Capability Environment (FACE) standard
5 key factors to consider when selecting an embedded testing tool

Related blog posts

Metrowerks CodeTest - How and why to upgrade

.
2021-02-01

Generating low level tests from system tests

.
2020-07-07

False positive and false negative in software testing

.
2019-05-22

Automating test generation with AUTOSAC

.
2017-07-20

Pagination

  • Current page 1
  • Page 2
  • Next page Next ›
  • Last page Last »
  • Solutions
    • Rapita Verification Suite
    • RapiTest
    • RapiCover
    • RapiTime
    • RapiTask
    • MACH178

    • Verification and Validation Services
    • Qualification
    • Training
    • Integration
  • Latest
  • Latest menu

    • News
    • Blog
    • Events
    • Videos
  • Downloads
  • Downloads menu

    • Brochures
    • Webinars
    • White Papers
    • Case Studies
    • Product briefs
    • Technical notes
    • Software licensing
  • Company
  • Company menu

    • About Rapita
    • Careers
    • Customers
    • Distributors
    • Industries
    • Locations
    • Partners
    • Research projects
    • Contact
  • Discover
    • AMC 20-193
    • What is CAST-32A?
    • Multicore Timing Analysis
    • MC/DC Coverage
    • Code coverage for Ada, C & C++
    • Embedded Software Testing Tools
    • Aerospace Software Testing
    • Automotive Software Testing
    • Certifying eVTOL
    • DO-178C
    • WCET Tools
    • Worst Case Execution Time
    • Timing analysis (WCET) & Code coverage for MATLAB® Simulink®

All materials © Rapita Systems Ltd. 2023 - All rights reserved | Privacy information | Trademark notice Subscribe to our newsletter