Iker Arizmendi <[EMAIL PROTECTED]> wrote:
> Using pysqlite2 I noticed (using ps) that whenever I connected to
> a database for the first time an extra thread is spawned. At first
> I thought this might be the doing of pysqlite but a quick test with
> the sqlite3 command line tool confirmed that this occurs within
> sqlite3 itself:
> 
>     $ sqlite3 gen-us_en.db
>     SQLite version 3.3.6
>     Enter ".help" for instructions
>     sqlite>
>     [1]+  Stopped                 sqlite3 gen-us_en.db
>     $ ps
>       PID TTY          TIME CMD
>      5484 pts/16   00:00:00 bash
>      5753 pts/16   00:00:00 sqlite3
>      5754 pts/16   00:00:00 sqlite3
>      5757 pts/16   00:00:00 ps
>     $ cat /proc/version
>       Linux version 2.6.11-gentoo-r4 (gcc version 3.3.5 (Gentoo
>       Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1))
>       #6 SMP Mon Apr 4 10:20:09 EST 2005
> 
> A look at the sqlite3 source shows that pthread_create
> is only called twice and is immediately followed by a
> matching pthread_join - where does the extra thread come from?
> 

The extra thread checks for a partular bug in pthreads
on some older Linux systems.  If the bug is present, SQLite
has to take active steps to work around it.
--
D. Richard Hipp   <[EMAIL PROTECTED]>

Reply via email to