Share via

Is it possible to requeue a task when using the threadpool I/O API?

loop123123 1 Reputation point
2023-02-08T20:58:31.39+00:00

When using Windows' current threadpool I/O API -- i.e., CreateThreadpoolIo, StartThreadpoolIo, etc. -- is there any way to requeue a task?

For example, if you're using ReadDirectoryChangesW, and you need to access one of the files changed, but it's temporarily locked, you might want to requeue the task so that you can try again later. Is there a way to do that using the API?

Windows development | Windows API - Win32
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. Jeanine Zhang-MSFT 11,356 Reputation points Microsoft External Staff
    2023-02-09T03:15:15.6366667+00:00

    Hello,

    Welcome to Microsoft Q&A!

    As far as I'm concerned, there is no suitable api to requeue the task. You could try to cancel I/O requests that are slow or blocked. And then it is allowed to make the call again with the new parameters, without terminating the application. I suggest you could refer to the Doc: Canceling Pending I/O Operations.

    Thank you.

    Jeanine


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.