On 14 Jan 2019, at 6:34pm, Thomas Kurz <sqlite.2...@t-net.ruhr> wrote:

>> pragma_busy_timeout
> 
> Does setting the busy_timeout retry periodically (e.g. every x milliseconds), 
> or is there some automatism that ensures that the requested operation is done 
> just-in-time as soon as the previous/blocking operation is finished?

The busy_timeout setting is the maximum amount of time that the busy_timeout 
routine is allowed to run.  That routine is not expected to sleep for that 
amount of time you set in a single sleep.

SQLite's own busy_timeout routine (the one you get if you don't supply your 
own) uses exponential backoff.  It first sleeps for a very small amount of 
time, then checks the lock.  If access is still prevented it sleeps longer, 
then checks again.  Then longer still, then longer still, until the amount of 
time /since the routine started/ exceeds the timeout you set.

The "just-in-time" idea mentioned in your question doesn't work in real life, 
since constantly checking mutex status keeps one core completely busy, using 
lots of power and generating lots of heat.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to