-
Notifications
You must be signed in to change notification settings - Fork 192
Fix https://github.com/jsk-ros-pkg/jsk_recognition/issues/2860 #2866
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
Conversation
fbeae6a
to
08ed039
Compare
|
CI green |
can you compare calculation speed in single thread with and whitout this PR? because libsiftfast is originally developed to pursue high speed processing by several optimization technique, so I'd like to know how this changes the performance. |
What do you mean? Making the nodelet's num_worker_thread=1 or making the libsiftfast's OpenMP flag OFF? |
sorry |
…when more than 2 nodelets are loaded to the same nodelet manager
08ed039
to
1cfce13
Compare
I've tested the performance with launching With this PR
Without this PR
|
close #2860
libsiftfast
has so many static global variables, so it is not thread-safe when called from multiple nodelets. This PR adds a global mutex to restrict the access to those variables to make it thread-safe.Since the entire mutex is taken, if n imagesift nodelet are loaded, the time required to compute each feature is n times longer. But I think it is fine because the node is implemented with ConnectionBasedNodelet. If the user doesn't subscribe, the slow calculation doesn't occur. Making the user code work is much important.
The clean method is to make libsiftfast thread-safe, but I think we should write it from scratch or use OpenCV if we do so.
You can try the bug occurs just reverting 365b2d0 and execute
test_two_imagesift.test