[cl-sqlite-devel] [patch] timeout support

Kalyanov Dmitry kalyanov.dmitry at gmail.com
Mon Jul 27 05:43:14 UTC 2009


On Friday 24 July 2009 05:30:02 James Wright wrote:
> Hi,
>
> I've been using cl-sqlite to dump results from parallel processes into
> a sqlite db.  The problem with this is that sometimes two processes
> will attempt to write to the file at the same time.  The sqlite
> library will retry, but it will only do so if a timeout has been set
> on the connection.  I've added timeout/retry support to cl-sqlite, and
> I thought it might be useful to others, so I've attached a patch.
>
> I don't have a platform-independent unit test, since I believe it
> needs threads to test properly, but I've attached (in
> 'sqlite-noodling.lisp') a file that reproduces the problem (function
> `tst1') and shows that the fix actually fixes it (`tst2').
>
>       James

Thanks!

I've applied the patch to git. I've changed test to use bordeaux-threads 
(threading compatibility library).

Did you try tests on a multi-core machine? On my single-core machine tests 
start failing only with larger amount of writers and threads.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <https://mailman.common-lisp.net/pipermail/cl-sqlite-devel/attachments/20090727/00577a00/attachment.sig>


More information about the cl-sqlite-devel mailing list