Skip to content

improve thread safety of UnitFormulaFormatter, PowerUnitsCheck#233

Merged
fbergmann merged 1 commit intosbmlteam:developmentfrom
lkeegan:fix_232_UnitFormulaFormatter_PowerUnitsCheck
May 30, 2022
Merged

improve thread safety of UnitFormulaFormatter, PowerUnitsCheck#233
fbergmann merged 1 commit intosbmlteam:developmentfrom
lkeegan:fix_232_UnitFormulaFormatter_PowerUnitsCheck

Conversation

@lkeegan
Copy link
Copy Markdown
Contributor

@lkeegan lkeegan commented May 30, 2022

Description

  • use a local map to store component values inside UnitFormulaFormatter, PowerUnitsCheck instead of using the static map in SBMLTransforms
  • now safe to call these functions from multiple threads

Motivation and Context

partial fix for #232

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Change in documentation

Checklist:

  • I have updated all documentation necessary.
  • I have checked spelling in (new) comments.

Testing

  • Testing is done automatically and codecov shows test coverage
  • This cannot be tested automatically

- use a local map to store component values instead of using the static map in SBMLTransforms
- now safe to call these functions from multiple threads (see sbmlteam#232)
Copy link
Copy Markdown
Member

@fbergmann fbergmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, since you are replacing just the mapComponentValues, this will not be more expensive than the existing code.

@fbergmann fbergmann merged commit 52183c6 into sbmlteam:development May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants