Re: [sqlite] Request for an example code use async IO

2011-04-05 Thread Ricky Huang
On Apr 4, 2011, at 7:10 PM, Pavel Ivanov wrote:

>> Can someone be so kind as to provide a short example of initializing 
>> asynchronous module, opening DB for read/write, create a table, and write 
>> some data to it?
> 
> […] All you need to do is to initialize async module and call 
> sqlite3async_run in the dedicated thread. […]

Thanks for getting back to me Pavel.

So let me see if I understand what you said:

Main thread:
  - Starts child thread
  - sqlite3_open_v2()
  - sqlite3_exec(), sqlite3_prepare_v2()/sqlite3_step(), etc
  - sqlite3_close()
  - Halts and joins child thread

Child thread:
  - sqlite3async_initialize()
  - sqlite3async_run()
  - sqlite3async_shutdown()


is that correct?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Request for an example code use async IO

2011-04-04 Thread Ricky Huang
Hi,

I am planning on incorporating the sqlite3async module into my project to 
improve code responsiveness during disk writes.  I've Googled all over for 
example code on using the module but can't find any.

Can someone be so kind as to provide a short example of initializing 
asynchronous module, opening DB for read/write, create a table, and write some 
data to it?


Thanks in advance.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Use sqlite3_update_hook() to watch for changes

2009-03-20 Thread Ricky Huang
Here's my scenario, I have two applications, reader and a writer, and  
a shared database.  Writer will be writing changes to the database and  
reader will be reading.  Originally my idea was for the reader to use  
sqlite3_update_hook() to watch for database changes.  But after I got  
the code written, the hooked function was never called.  A little  
inter-tubes research revealed this: http://tinyurl.com/dc279r.  It  
basically says sqlite3_update_hook() is not designed for that.

My question is, does SQLite offer ways of hooking up a second  
application to changes in a shared DB without polling?

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users