[Digikam-devel] Threading in digiKam

Alex Jironkin alexjironkin at gmail.com
Sat May 1 17:16:16 BST 2010


There is no threading in libface anyways so the only thing left is to implement thread safety with simple mutex locks.



On 1 May 2010, at 14:14, Marcel Wiesweg wrote:

> 
>> Hi Everyone!
>> 
>> The GSoC community bonding period has started. My exams just got over and
>> I'm trying to get familiar with digiKam's workings.
>> Now, a major concern is that libface's methods should be thread-safe to be
>> usable in digKam.
>> 
>> pthreads are POSIX-only. So, I'd like to know what sort of threading
>> digiKam uses. I can browse the code myself, but it'd be faster if someone
>> points me to some relevant source files which make use of threading, just
>> so that I can learn quicker.
> 
> Of course, we use Qt ;-) 
> If you now feel the need, reconsider to build upon Qt Core at least. It's 
> about as cross-platform as it gets nowadays.
> 
> Also think about if you want to have thread-safety or reentrancy:
> 
> Reentrancy is often easily achieved. Store your data in a C++ object and do 
> not use any global-static data structures. Now a single object can only be 
> used from a single thread, but this is usually absolutely sufficient.
> If usage of global-static data is needed for optimization purposes, it is 
> critical to make this thread-safe, to mutex-protect them. See above for my Qt 
> hint.
> 
> Thread-safe means that the same single object can be access from multiple 
> threads. This requires strict mutex protection for all methods, but is usually 
> unnecessary for objects like images.
> 
> Marcel
> _______________________________________________
> 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