GNU bug report logs -
#32209
Cuirass: Use SQLite in Multi-thread mode
Previous Next
Reported by: Clément Lassieur <clement <at> lassieur.org>
Date: Thu, 19 Jul 2018 10:56:01 UTC
Severity: normal
Tags: patch
Done: Clément Lassieur <clement <at> lassieur.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#32209: Cuirass: Use SQLite in Multi-thread mode
which was filed against the guix-patches package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 32209 <at> debbugs.gnu.org.
--
32209: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=32209
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:
> Hello!
>
> Clément Lassieur <clement <at> lassieur.org> skribis:
>
>> This disables mutexing on database connection and prepared statement objects,
>> thus making us responsible for serializing access to database connections and
>> prepared statements. It may result in a performance improvement.
>>
>> * src/cuirass/database.scm (db-init, db-open): Pass the SQLITE_OPEN_NOMUTEX
>> flag to SQLITE-OPEN.
>
> Could you copy (part of) the paragraph above as a comment above the
> ‘sqlite-open’ call in ‘db-open’?
Done, and pushed. Thanks!
Clément
[Message part 3 (message/rfc822, inline)]
This disables mutexing on database connection and prepared statement objects,
thus making us responsible for serializing access to database connections and
prepared statements. It may result in a performance improvement.
* src/cuirass/database.scm (db-init, db-open): Pass the SQLITE_OPEN_NOMUTEX
flag to SQLITE-OPEN.
---
src/cuirass/database.scm | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index a84d0fa..6bf3bc4 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -195,7 +195,8 @@ database object."
(format (current-error-port) "Removing leftover database ~a~%" db-name)
(delete-file db-name))
(let ((db (sqlite-open db-name (logior SQLITE_OPEN_CREATE
- SQLITE_OPEN_READWRITE))))
+ SQLITE_OPEN_READWRITE
+ SQLITE_OPEN_NOMUTEX))))
(db-load db schema)
(db-set-schema-version db (latest-db-schema-version))
db))
@@ -222,7 +223,9 @@ database object."
;; avoid SQLITE_LOCKED errors when we have several readers:
;; <https://www.sqlite.org/wal.html>.
(set-db-options (if (file-exists? db)
- (db-upgrade (sqlite-open db SQLITE_OPEN_READWRITE))
+ (db-upgrade
+ (sqlite-open db (logior SQLITE_OPEN_READWRITE
+ SQLITE_OPEN_NOMUTEX)))
(db-init db))))
(define (db-close db)
--
2.18.0
This bug report was last modified 6 years and 302 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.