Skip to content
Discussion options

You must be logged in to vote

It depends on two factors:

  1. What part of that "global object" is used in the computation for the mesh? Is it the whole object? A subset of it?
  2. Is the global object read only or mutable? Can the subset of the object be mutated while you run the mesh generation?

If the answer to (2) is "yes". Then the rust type system actually saved you from hitting nasty bugs! You should consider an alternative design. It's because you can't predict what happens first when two different threads try to access the same data, and it is likely that you would get two different results when running the software two different times, for the same code… This is called a race condition.

So assuming you don't mutate…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@davids91
Comment options

@nicopap
Comment options

nicopap Aug 13, 2023
Collaborator

@davids91
Comment options

Answer selected by davids91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants