SQLite Forum

Dispatch Sqlite Instance with event loop
Login
I use a single thread event loop for my code, like nodejs.


I need create a sqlite connection pool for each request,  and dispatch the sqlite connection into a dedicated thread to do some query with uv_work.  

http://docs.libuv.org/en/v1.x/threadpool.html


I can guarantee each sqlite connection will be used by one worker thread all the time.   


I can not bind sqlite connection into one thread all the time, every uv_work call will assign a random idle thread to do the work. (every time I create a uv_work for a request if I need database query)


This design will cause problem ?

The sqlite will be always open by one process with excl-unix vfs,  SQLITE_CONFIG_MULTITHREAD will be setup.