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

jetcam thread race - read thread and processing thread #37

Open
PhilipsKoshy opened this issue Dec 1, 2021 · 0 comments
Open

jetcam thread race - read thread and processing thread #37

PhilipsKoshy opened this issue Dec 1, 2021 · 0 comments

Comments

@PhilipsKoshy
Copy link

PhilipsKoshy commented Dec 1, 2021

with camera.running = True, jetcam spawns a thread which reads into camera.value

Now let's say we do, new_image = change['new'] and do some processing. I guess Python does shallow copying and only assigns a reference to the original image array in the new_image variable. So, effectively, new_image and camera.value are pointing to the same memory region. Lets say my processing-thread takes a very long time. In the mean time, camera.value is updated by jetcam-thread. This can cause a thread race. Is that right?

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

1 participant