Changes In Branch v1.80-cached-writes Through [eee1dce5a3] Excluding Merge-Ins
This is equivalent to a diff from 1e29e5e90e to eee1dce5a3
2023-10-13
| ||
20:42 | Merged in cached writes check-in: cdc7397963 user: matt tags: v1.80-matt-fixme | |
20:41 | Oops. Forgot to clean out the cache after processing the cached writes Leaf check-in: b564f3f99c user: matt tags: v1.80-cached-writes | |
2023-10-12
| ||
21:04 | Cached writes for steps working correctly check-in: eee1dce5a3 user: matt tags: v1.80-cached-writes | |
03:52 | wip check-in: a560665ddd user: matt tags: v1.80-cached-writes | |
2023-10-09
| ||
19:51 | Merged v1.80 in check-in: 38506ffe03 user: matt tags: v1.80 | |
2023-10-06
| ||
16:56 | Fixed dbmod:attach-sync so that it works for the non-id rows. Adjusted some log messages. Removed old lock files check-in: 1e29e5e90e user: mmgraham tags: v1.80 | |
2023-09-25
| ||
19:04 | Added sync file age checking to -db2db check-in: 72065b6c5e user: mmgraham tags: v1.80 | |
Modified api.scm from [c477d1f287] to [b3b853adfc].
︙ | |||
369 370 371 372 373 374 375 | 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | + - + + | ((dec-var) (apply db:dec-var dbstruct params)) ((del-var) (apply db:del-var dbstruct params)) ((add-var) (apply db:add-var dbstruct params)) ((insert-run) (apply db:insert-run dbstruct params)) ;; STEPS ((teststep-set-status!) |
︙ |
Modified db.scm from [a33d322bf7] to [43baddb3c1].
︙ | |||
4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 | 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | (begin (debug:print 0 *default-log-port* "WARNING: path given, " outputfile " is relative, prefixing with current directory") (conc (current-directory) "/" outputfile))) results) ;; brutal clean up (dbfile:add-dbdat dbstruct #f dbdat) (system "rm -rf tempdir"))) ;;====================================================================== ;; cached writes stuff ;;====================================================================== (define (db:add-cached-write dbstruct proc run-id params) (debug:print 0 *default-log-port* "Adding cached write for run-id "run-id" params " params) (mutex-lock! *cached-writes-mutex*) (let* ((hkey (cons dbstruct run-id)) (cached-writes-queue (hash-table-ref/default *cached-writes-queues* hkey '()))) (hash-table-set! *cached-writes-queues* hkey (cons (list proc params) cached-writes-queue))) (if (not *cached-writes-flag*) (begin (set! *cached-writes-flag* #t) (thread-start! (make-thread (lambda () (debug:print 0 *default-log-port* "process cached writes thread started.") (thread-sleep! 1) (db:process-cached-writes-queue)))))) (mutex-unlock! *cached-writes-mutex*)) (define (db:process-cached-writes-queue) (mutex-lock! *cached-writes-mutex*) (hash-table-for-each *cached-writes-queues* (lambda (hkey writes-list) (let* ((dbstruct (car hkey)) (run-id (cdr hkey))) (debug:print 0 *default-log-port* "Processing "(length writes-list)" cached writes for run "run-id) (db:with-db dbstruct run-id #t (lambda (dbdat db) (sqlite3:with-transaction db (lambda () (for-each (lambda (queued-write) (match queued-write ((proc params)(apply proc dbstruct params)) (else (assert #f "BAD queued-write")))) writes-list)))))))) (set! *cached-writes-flag* #f) (mutex-unlock! *cached-writes-mutex*)) ;; (db:extract-ods-file db "outputfile.ods" '(("sysname" "%")("fsname" "%")("datapath" "%")) "%") ;;====================================================================== ;; moving watch dogs here due to dependencies ;;====================================================================== |
︙ |
Modified dbfile.scm from [1a2e6b4c5e] to [1b4ea0f0d4].
︙ | |||
1436 1437 1438 1439 1440 1441 1442 1443 1444 | 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 | + + + + + + + + + + | (result (or stmth (let* ((newstmth (sqlite3:prepare db stmt))) ;; (db:hoh-set! stmt-cache db stmt newstmth) (hash-table-set! stmt-cache stmt newstmth) newstmth)))) (mutex-unlock! *get-cache-stmth-mutex*) result)) ;;====================================================================== ;; cached writes - run list of procs inside transaction ;; NOTE: this only works because we have once database per process ;;====================================================================== (define *cached-writes-mutex* (make-mutex)) (define *cached-writes-flag* #f) (define *cached-writes-queues* (make-hash-table)) ;; dbstruct->list of writes ) |