#๐Ÿ”’ Should I switch from multi-threading to parallel processing

7 messages ยท Page 1 of 1 (latest)

covert lily
#

I am running a control system where I need to send actions to a NIdaq board, using a controller based on some state gathered from an image. This state is just a mean of a kernel from an image acquired through a camera run by a third party software. I am processing these images coming in at 70Hz using a multi threaded method and a saving them using a number of threaded writers. The control system runs in the main thread using the real time state gathered from the threaded method.
I am having an issue with updating the controller lets say u = k@state at the same freq as the image thread. I do not understand PIL conpletely and want to know if I should switch to parallel processing.
PS: i will add a pseudo code here in a short while for reference

turbid waspBOT
#

@covert lily

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

jade moth
#

maybe add a lock for your state writing?

covert lily
#

what does that do to the state sharing between threaded function and main loop?

jade moth
#

blocks it for your state write

turbid waspBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.