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

Is packet sending threadsafe? #13

Open
eric-wieser opened this issue Jan 6, 2016 · 1 comment
Open

Is packet sending threadsafe? #13

eric-wieser opened this issue Jan 6, 2016 · 1 comment
Labels

Comments

@eric-wieser
Copy link
Contributor

Can I use the objects in the devices module from two threads simultaneously

@mitchgu
Copy link
Owner

mitchgu commented Jan 6, 2016

With my understanding of how the GIL and python threads work, I think two threads on the same process actually can't run in parallel. Since the properties in the devices are assigned to more or less atomically, I think it's fine in most cases. Furthermore, the information flow is pretty one directional, as long as the user knows to never write to a device's property. I could be misunderstanding things though. If problems arise in the future I can add a lock to devices to access its properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants