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

Mutex not released with run_in_background #289

Closed
1 task done
blaine141 opened this issue Feb 28, 2022 · 1 comment
Closed
1 task done

Mutex not released with run_in_background #289

blaine141 opened this issue Feb 28, 2022 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@blaine141
Copy link

Describe the Bug
Mutex is not nicely released when getting a buffer from the background thread and there is not one queued. This is expressed as a random pause in the camera stream followed by a large number of frames coming through at once. The specific line of issue is this one. It blocks while trying to grab a buffer from the queue, but since it is holding the mutex, the queue can never be filled. The loop also never yields control to the background thread which is what causes the long pause.

To Reproduce
Steps to reproduce the behavior:

  1. Make some tool to display frames from the camera and enable run_in_background
  2. Force it to grab a frame when there is not one available. Can be done by grabbing faster than frame rate.
  3. Observe the large pause as the thread cannot gain possession of the mutex to add to the buffer queue.

Expected Behavior
No pause, the mutex is released back to the background thread and it provides the next buffer.

Configuration

  • OS: Windows
  • Python: Python 3.6
  • Harvester: 1.3.2
  • GenTL Producer: MatrixVision
  • Camera: Flir Blackfly

Actions You Have Taken

  • I have tested a solution to the problem and will be making a related PR.

  • I've read the Harvester FAQ page.

Additional context
In my application, I have to always have the background thread on

blaine141 pushed a commit to blaine141/harvesters that referenced this issue Feb 28, 2022
kazunarikudo added a commit that referenced this issue Mar 1, 2022
@kazunarikudo
Copy link
Member

@blaine141 Hi, please feel free to close this ticket if you can confirm the issue has been fixed. Regards, Kazunari.

@kazunarikudo kazunarikudo added the bug Something isn't working label Mar 1, 2022
@kazunarikudo kazunarikudo added this to the 1.3.3 milestone Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants