chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Optional sqlite3 egg update


From: F. Wittenberger
Subject: Re: [Chicken-users] Optional sqlite3 egg update
Date: Tue, 07 Mar 2006 11:02:05 +0100

Hi Thomas,

Am Montag, den 06.03.2006, 22:34 +0000 schrieb Thomas Chust:
> Hello,
> 
> the SQLite3 bindings got a big update and now support user defined 
> collation sequences and SQL functions written in Scheme. They also do 
> automagical recompilation of stale statements now.

Nice work.

Would you mind to share your experiences about inference with user level
threading?

Background: for Askemos (www.askemos.org a kind of p2p web server with
byzantine shared state of web apps) I wrote a sqlite3 binding to
rscheme.  Now rscheme and chicken are quite simillar wrt. threading.
Therefore we've been very careful never to call any procedure of unbound
execution time from the scheme thread.  (See the leventshein
implementation in the askemos source how we've been jumping back and
forth to create a scheduling friendly mix of Scheme and C code, since
leventshein's quadratic behavior could easily kill anything other
thread).

The sqlite3 binding of mine (which is rough in comparision the your egg)
and the egg share this problem: calling sqlite3_step can potentially
take for ever.  I'm not yet sure, but I feel that since I'm using
sqlite3 with askemos, it's sometimes suddenly unbearable unresponsive
and this seems to corellate with sqlite3 calls (probably autocommit).

Therefore I consider to throw much more C code in and associate a
pthread per sqlite3 struct, which would perform the actual calls and
call back to Scheme, when sqlite3 is done.

Do you think this is approach is useful and might be something to do
with the chicken egg too?  Or would your experience suggest otherwise,
e.g. sqlite beeing so fast, we would rarely notice and I better go back
and find out where exactly those sudden delays come from.

best regards

/Jörg

--- sqlite3.scm~        2006-03-06 22:33:56.000000000 +0100
+++ sqlite3.scm 2006-03-07 10:21:28.000000000 +0100
@@ -524,7 +524,7 @@

 ;; check whether the database is in autocommit mode
 (define (sqlite3:auto-committing? db)
-  (check-type 'sqlite3:auto-committin? db <sqlite3:database>)
+  (check-type 'sqlite3:auto-committing? db <sqlite3:database>)
   ((foreign-lambda bool "sqlite3_get_autocommit" sqlite3:database) db))

 ;; get the number of changes made to the database






reply via email to

[Prev in Thread] Current Thread [Next in Thread]