Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

any_object possible concurrency problems -> strict checking? #190

Open
feefladder opened this issue Nov 12, 2021 · 1 comment
Open

any_object possible concurrency problems -> strict checking? #190

feefladder opened this issue Nov 12, 2021 · 1 comment

Comments

@feefladder
Copy link
Contributor

Since the any_object class does not specify intent and is passed (AFAIK) as-is to other processes, there could be concurrency problems when multiple processes try to mutate it.

possible solutions

This could be solved manually by the user once custom dependencies are in effect. However, it may be nice to also add intent and strict checking for the any_object class

@benbovy
Copy link
Member

benbovy commented Mar 2, 2022

Hi @joeperdefloep, sorry for the wait, I've been silent in this repository for too long.

any_object actually implicitly defines VarIntent.OUT, so I think in theory it shouldn't be possible to have a model with another process making reference to it and changing its value.

  • a xs.foreign(..., intent='out') reference to such variable should raise an error at model creation
  • trying to set a value of a xs.foreign(..., intent='in') reference should raise an error at simulation runtime (read-only property)

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

No branches or pull requests

2 participants