Skip to content
Understand by Scitools
Menu
  • Home
  • 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.

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
  • Power User Tips
  • Programming Practices
  • Uncategorized
  • Useful Scripts
  • 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

©2023 SciTools Blog | Design: Newspaperly WordPress Theme