Re: Fwd: KActivities library optimizations

2012-09-03 Thread Michael Pyne
On Monday, September 03, 2012 13:31:47 Ivan Čukić wrote:
 Hi,

 The latest master of libkactivities caches and pre-fetches some stuff like
 the currentActivity, list of activities, list of running activities,
 activity names and icons, to minimise the amount of d-bus related locks*.

 What do you think of the idea to go one step further, and instead of
 accessing the data via d-bus, to only use d-bus for signalling the changes,
 but to use QSharedMemory for actual data access (read-only from the
 library). This would remove any blocking while accessing the data, unless
 I'm missing some important fact about QSharedMemory which makes it
 undesired.
 (I don't see it much in our code)

It adds a lot of things you'd need to be careful about (e.g. how to ensure the
data is still in shared memory between when the signal is sent and when the
DBus slots are finally called and processed, naming the key for the memory
segment, etc.), but the idea is sound.

Regards,
 - Michael Pyne

signature.asc
Description: This is a digitally signed message part.


Re: Fwd: KActivities library optimizations

2012-09-03 Thread Ivan Čukić

 It adds a lot of things you'd need to be careful about (e.g. how to ensure
 the data is still in shared memory between when the signal is sent and when
 the DBus slots are finally called and processed, naming the key for the
 memory segment, etc.), but the idea is sound.

The idea is to keep the basic structures - the list of activities with names, 
icon names and states always in the shared memory. So, not having them only 
until the client retrieves them - but persistent.

The client could access the needed info nevertheless it got the signal that it 
has changed or not.

Cheerio,
Ivan



-- 
Make your code readable. Pretend the next person who looks
at your code is a psychopath and they know where you live.
  -- Philip Wadler


signature.asc
Description: This is a digitally signed message part.