Multithreading
Applications commonly use multiple threads instead of asynchronous processing.
The application creates a separate thread and calls an ODBC function on it,
and then continues processing on the main thread. Rather than having to
continually poll the asynchronous function, as is the case when the
SQL_ATTR_ASYNC_ENABLE statement attribute is used, the application can simply let the newly created
thread finish.
Functions that accept a statement handle and are running on one thread can be
canceled by calling SQLCancel with the same statement handle from another thread. Although drivers should
not serialize the use of SQLCancel in this manner, there is no guarantee that calling SQLCancel will actually cancel the function running on the other thread.