Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Aborting synchronous function call,....

1 view
Skip to first unread message

Kerem Gümrükcü

unread,
Dec 20, 2009, 12:54:01 PM12/20/09
to
Hi,

what is the best way to abort a synchronous function call or
better to say make the call abortable,...

Regards

Kerem

--
-----------------------
Beste Gr�sse / Best regards / Votre bien devoue
Kerem G�mr�kc�
Latest Project: http://www.pro-it-education.de/software/deviceremover
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------

m

unread,
Dec 20, 2009, 5:55:14 PM12/20/09
to
Obviously, this depends on the function in question. If the API is in
Windows or a third party library, then the best advise I can give is don't
try.

If you want to write or modify one of your own APIs to be abortable, then I
can suggest that this is commonly done by replacing a call to
WaitForSingleObject with a call to WaitForMultipleObects + CancelIo & the
abort achieved by a call to SetEvent. Of course, the implementation details
of your API will dictate how cancelation should proceed since it depends on
where in the execution you want the call to be cancelable - clearly, there
will be some places that will execute before cancelation is possible, and
after it is no longer possible.

"Kerem G�mr�kc�" <kare...@hotmail.com> wrote in message
news:O6zbp1Zg...@TK2MSFTNGP05.phx.gbl...

Pavel A.

unread,
Dec 21, 2009, 7:42:16 PM12/21/09
to
"Kerem G�mr�kc�" <kare...@hotmail.com> wrote in message
news:O6zbp1Zg...@TK2MSFTNGP05.phx.gbl...
> Hi,
>
> what is the best way to abort a synchronous function call or
> better to say make the call abortable,...


On Vista+ there's a new API, CancelSynchronousIo to cancel functions that
were not
cancelable before (like CreateFile). But this is only for NT6.

--pa

0 new messages