On Tue, 2 May 2017 09:38:30 +0200 Olivier Mascia <o...@integral.be> wrote:
> > Le 2 mai 2017 à 09:00, John Found <johnfo...@asm32.info> a écrit : > > > > What is the best way (less CPU consuming) to put a thread in sleep and wake > > it up when new record has been written to a given table of SQLite database? > > > > Now I am implementing this by polling and time based sleep, but such > > solution is very dirty compromise, trading response time for CPU load. I > > want both. :) > > > > -- > > http://fresh.flatassembler.net > > http://asm32.info > > John Found <johnfo...@asm32.info> > > Reading your question I assume a single, multi-threaded, application. You > could write a SQL function (see sqlite3_create_function_v2 and associates) > which signal an event. And add a SQL trigger calling this function when > appropriate. In my case I have several running applications that write in the database. But isn't this solution applicable nevertheless? Maybe with some kind of IPC. > > > -- > Best Regards, Meilleures salutations, Met vriendelijke groeten, > Olivier Mascia, http://integral.software > > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users -- http://fresh.flatassembler.net http://asm32.info John Found <johnfo...@asm32.info> _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users