How do I notify a process of an SQLite database change done in a different process?

前端 未结 7 2515
南笙
南笙 2021-02-19 16:27

Let\'s say I have two or more processes dealing with an SQLite database - a \"player\" process and many \"editor\" processes.

The \"player\" process reads the database

7条回答
  •  北海茫月
    2021-02-19 17:27

    How many editor processes (why processes?), and how often do you expect updates? This doesn't sound like a good design, especially not considering sqlite really isn't too happy about multiple concurrent accesses to the database.

    If multiple processes makes sense and you want persistence, it would probably be smarter to have the editors notify your player via sockets, pipes, shared memory or the like and then have the player (aka server process) do the persisting.

提交回复
热议问题