On Jul 1, 2008, at 10:33 AM, Joel VanderWerf wrote:

> Yes, sqlite does synchronize, but a potential problem is  
> granularity: a writer gets an exclusive lock on the entire db.



but only very briefly, in practice the throughput is close to what you  
can achieve with mutexes combined with the mri thread scheduler

   http://www.sqlite.org/lockingv3.html

one of the reasons this is true is that for a heavily threaded ruby  
program (green threads) you end up with the entire process sometimes  
blocked on io and the threads end up getting into a pattern where all  
of them need to write at once - a kind of rhythm - with processes the  
ability for the OS to schedule access to resources ends up staggering  
the phase of execution so access is generally faster than it 'ought'  
to be taking only TPS into account.

this a *wild* generalization based only on the kinds of parallel  
processing i've done, but i've seen the pattern where a heavily  
threaded program ends up being effectively serial enough times to  
mention it...

a @ http://codeforpeople.com/
--
we can deny everything, except that we have the possibility of being  
better. simply reflect on that.
h.h. the 14th dalai lama