Thank you guys for the suggestion. That's what I really need. Which one is better, the sqlite3_interrupt() or sqlite3_progress_handler()? My gut feeling is that sqlite3_interrupt() should be better since it does not interfere with the running of the query until it is signaled. Besides, the progress_handler does not actually give me the right proportion of completion... Or is there a way I can know proportion of completion from it?

thanks again,

Radzi.

----- Original Message ----- From: "Igor Tandetnik" <[EMAIL PROTECTED]>
To: "SQLite" <sqlite-users@sqlite.org>
Sent: Wednesday, October 11, 2006 8:43 AM
Subject: [sqlite] Re: Terminating long query in C ?


[EMAIL PROTECTED] wrote:
sqlite3_interrupt() has long been used by the sqlite3 shell program.
When you press control-C a posix signal handler invokes
sqlite3_interrupt() to stop the current query.  (This only works on
posix, of course.)  The original purpose of sqlite3_interrupt() was
to support ^C in the shell, and for that purpose the thread
restriction
was entirely reasonable.

It is easy to understand how this use of sqlite3_interrupt() might
have escaped the notice of users on non-posix systems.

One can register a Ctrl-C handler on Windows with SetConsoleCtrlHandler. But the handler is invoked on a background thread created by the system specifically for this purpose, so sqlite3_interrupt couldn't be used there, either.

Igor Tandetnik

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------





-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to