[Digikam-devel] Threading in digiKam

Alex Jironkin alexjironkin at gmail.com
Sun May 2 19:29:48 BST 2010


Hi Marcel,

Yeah there are some global structures i.e. like the face recognition config. 

I have asked if Aditya wanted to implement simple mutex lock in libface using couple of boolean variables in the main class. Also described some use cases, hopefully this should be enough to get him going and finish it quickly.

I am also assuming, please correct me if I am wrong, that a single instance of LibFace will be created and then shared between threads. Which means that we will lock appropriate methods only from being run in separate threads at the same time. E.g. things like if one thread updating the face recognition config everything else will have to wait. But 2 face recognition methods in separate threads can be run at the same time, as they are only reading from the config.


I am also putting finishing touches on getting and loading config from/into LibFace as strings and storing them in database in this case. Otherwise you can also let libface store them in separate XML file in some directory. But thats besides the point.

Alex

On 2 May 2010, at 14:30, Marcel Wiesweg wrote:

> 
>> There is no threading in libface anyways so the only thing left is to
>> implement thread safety with simple mutex locks.
> 
> Do you use any global-static data structures? Or does OpenCV use them?
> Otherwise all will be fine already.
> As I wrote before, we'll need reentrant code. If there are singleton classes, 
> you'll need to mutex-protect them.
> _______________________________________________
> Digikam-devel mailing list
> Digikam-devel at kde.org
> https://mail.kde.org/mailman/listinfo/digikam-devel

If we knew what we were doing, it wouldn't be called research, would it?
-- Albert Einstein






More information about the Digikam-devel mailing list