Simone Mosciatti wrote:
> it is suggested in several place to don't share a connection between forks.

Because of how locking and file handles interact.

> However I fail to see how this can be a problem for purely in-memory database.

In-memory databases do not use a file handle or file locking.

> Different point if the database is backed by a regular file, however,
> in such case, couldn't I simply close the connection in the child

fork(2) says that
| the child does not inherit process-associated record locks from its
| parent (fcntl(2)).  (On the other hand, it does inherit fcntl(2) open
| file description locks and flock(2) locks from its parent.)

So closing the child's handle can break the parent's locks.


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

Reply via email to