-
Notifications
You must be signed in to change notification settings - Fork 57
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
Multithreaded detection/tracking #72
Conversation
Finally, I compiled and played quickly with the sample, it's pretty cool ! Nice work ! |
Thanks! More commits to follow today. |
26f1777
to
77539bf
Compare
By the way, what kind of tests would you have in mind to test an async thing like this? |
This is about all the changes I wanted to make. |
I'm posting the mail I wrote yesterday:
|
fca5232
to
59985d0
Compare
Regarding video tests, I answer here: #50 |
59985d0
to
98dd764
Compare
So, here is a small review. There are more or less important stuff, and stuff that we already discussed but apparently did not agree on:
|
Here are my responses:
|
f83fc92
to
4a9c680
Compare
Well, you asked for it, and here it is with all the grotesque glory of |
I would |
btw, you may want to use CMake's |
I don't think Good point about |
@ayberkozgur Still, your intention is to tell people if they are going to use multi-threading or not. Using |
Honestly, my intention is to ask them whether they have pthreads or not. It might be an implementation detail but it affects the build process heavily at this point. Note: I believe README would be the adequate place to note "pthreads or no multithreading as of now folks" |
|
dfb68de
to
4d17eb6
Compare
@ayberkozgur My point with |
@severin-lemaignan Yes, |
@ayberkozgur +1 for |
I think it should be My response to yours:
|
c21a9fa
to
dfe4740
Compare
ping @ayberkozgur for 3. : can you kindly explain for my slow brain the purpose of the sample (other than showing how to use multithreaded detection) ? |
There is pretty much no other reason, but why shouldn't this be a valid reason? Isn't a sample something that illustrates some functionality of a library? If we assume this is true, and that there is only timing information that you can show about multithreadedness without having to resort to external tools such as Your brain isn't slow, it's just too preoccupied with creating the flawless user API XD |
That's what my therapist says. I say it's all Severin's fault for not letting the old API be, with its 21024 undocumented classes. My therapist says I won't get any more pills, so I'm not sure I can deal with the addition of two methods whose sole purpose is to illustrate some internal value ;) I think it's enough to allow the user to play with background detection in real time in the sample. The user will "feel" that detection has a low latency, and is more regular than with DetectPeriodically. If the users wants to see precisely, they can use tools like top or gnome-system-monitor as you say. Displaying values seems a bit abstract, not to mention the fact that they are not accurate because of the smoothing... What would be cool though, would be to allow to switch between async and sync to feel the difference. No ? |
OK let's go with that for now. |
I didn't find anything to complain, so this PR would impress even my therapist ;) |
Solves issue #63.
Adds two new detection triggers to the API:
BACKGROUND_DETECT_PERIODICALLY
runs detection in a background thread. Detection is triggered only whenmCallsBeforeDetection
many calls tofind()
are made, just like inDETECT_PERIODICALLY
. As soon as the detection ends, tracked tags are updated. Calls tofind()
only run tracking.BACKGROUND_DETECT_ALWAYS
runs detection in a background thread as above, but detection is triggered as soon as the previous detection ends.There are a handful of
TODO
s to address and more commits will follow. For the meantime, I await your reviews.