After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 346338 - Threaded database
Threaded database
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: General
CVS
Other Linux
: Normal normal
: ---
Assigned To: Ruben Vermeersch
F-spot maintainers
Depends on: 346977
Blocks: 337724
 
 
Reported: 2006-07-01 08:53 UTC by Ruben Vermeersch
Modified: 2007-03-15 13:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Threaded database patch v1 (43.12 KB, patch)
2006-07-01 08:54 UTC, Ruben Vermeersch
none Details | Review
Threaded database patch v2 (43.97 KB, patch)
2006-07-02 07:06 UTC, Ruben Vermeersch
reviewed Details | Review

Description Ruben Vermeersch 2006-07-01 08:53:31 UTC
I've split out the threaded database patch from the workerthread patch as I'm planning to drop the workerthread in favor of a better command queueing model.
Comment 1 Ruben Vermeersch 2006-07-01 08:54:45 UTC
Created attachment 68235 [details] [review]
Threaded database patch v1

 Core.cs        |    1
 Db.cs          |  353 +++++++++++++++++++++++++++++++++++++----------
 ImportStore.cs |   53 +------
 MainWindow.cs  |  100 ++++++-------
 MetaStore.cs   |   69 +--------
 PhotoStore.cs  |  256 ++++++++++------------------------
 TagStore.cs    |   61 ++------
 Updater.cs     |   46 +-----
 8 files changed, 466 insertions(+), 473 deletions(-)
Comment 2 Ruben Vermeersch 2006-07-02 07:06:35 UTC
Created attachment 68257 [details] [review]
Threaded database patch v2

 .bzrignore         |   60 +++++++
 src/Core.cs        |    1
 src/Db.cs          |  349 +++++++++++++++++++++++++++++++++----------
 src/ImportStore.cs |   53 +-----
 src/MainWindow.cs  |  100 ++++++------
 src/MetaStore.cs   |   69 +-------
 src/PhotoStore.cs  |  256 +++++++++----------------------
 src/TagStore.cs    |   61 ++-----
 src/Updater.cs     |   46 +----
 9 files changed, 522 insertions(+), 473 deletions(-)

Improved version of the patch, this one uses Queue objects for the queues and eliminates all busy waiting. This way there's no extra CPU usage and no increased latency. It's threading for free!

I want to nominate this for CVS, it's finished and rock solid (as far as I can tell, I'm using it for months now).
Comment 3 Aaron Bockover 2006-07-02 20:38:34 UTC
I really don't think it should be implemented like this. The point is that QueuedSqliteDatabase (which is what a lot of this code is based on) is a layer on top of basic database support that adds QueuedSqliteCommands for async/queued execution inside a single sqlite database thread.

I say add the necessary transation support to a shared version of QueuedSqliteDatabase that both F-Spot, Banshee, and other applications can use and then implement your application-specific layer as a wrapper or sub-class.

It would be nice to get a lot of this shared functionality into a common assembly.
Comment 4 Ruben Vermeersch 2006-07-08 12:15:10 UTC
Sharing this will require gmcs, see bug 346977 for changes to the build system.
Comment 5 Stephane Delcroix 2007-03-15 13:59:00 UTC
The threaded database is in trunk now...