Skip to content
SciTools Blog
Menu
  • Home
  • Blog
  • Support
  • Contact
  • Login
  • Pricing
  • Free Trial
Menu
Chefs working on the same dish

Visualizing Shared Tasks

Posted on September 27, 2022

Abstract: Visualize an architecture of functions with the Shared Tasks graph.

What’s worse than having too many chefs in the kitchen working on the same dish? Thread concurrency problems.

A task – an independent thread of execution – manipulates and uses objects. When another task also reads or writes to the same object simultaneously, it may result in a race condition. I made a graph to help with this problem.

Using the Graph

First, make an architecture automatically with this script or manually in Understand. (Read more about automatically and manually creating architectures.)

Then, right click on the architecture and view the Shared Tasks graph.

Let’s check it out with 3 functions from Fastgrep. I’m viewing 3 functions in regexp.c called regatom, reginsert, and regoptail as my 3 tasks.

Shared Tasks graph

Although this is a small single-threaded sample, it includes a lot of call complexity, and even indirect recursion. Three out of the five global objects are shared. Let’s filter the reference arrows on the graph.

Filter modify/set only
Filter use only

Using the graph options, the references selected to be filtered out turn into dashed lines. The function calls are filtered out too. Next, let’s only show the shared objects.

Shared objects only

Finally, let’s simplify the graph by hiding the intermediate function calls.

Simple references

With this graph, it’s okay to have lots of chefs in the kitchen; they will all collaborate together to make something fantastic.

  • Instagram
  • Facebook
  • LinkedIn
  • Twitter
  • YouTube

Learn more about Understand's Features

  • Dependency Graph
    View Dependency Graphs
  • Comply with Standards
  • View Useful Metrics
  • Team Annotations
  • Browse Depenedencies
  • Edit and Refactor

Related

  • API
  • Architectures
  • Business
  • Code Comparison
  • Code Comprehension
  • Code Navigation
  • Code Visualization
  • Coding Standards
  • Dependencies
  • Developer Notes
  • DevOps
  • Getting Started
  • Legacy Code
  • Licensing
  • Metrics
  • Platform
  • Plugins
  • Power User Tips
  • Programming Practices
  • Uncategorized
  • Useful Scripts
  • User Stories
  • May 2025
  • January 2025
  • December 2024
  • November 2024
  • August 2024
  • June 2024
  • May 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • June 2023
  • April 2023
  • January 2023
  • December 2022
  • November 2022
  • September 2022
  • August 2022
  • May 2022
  • April 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

©2025 SciTools Blog | Design: Newspaperly WordPress Theme