Can we have asynchronous versions of callbacks / events?

The OS sends a request to the file system and expects the file system to return the data. While it's possible to postpone the request, this is just a partial measure. So callbacks/events in CBFS Connect are synchronous; i.e., your code must return the data upon request.

You can have a worker thread (or several threads) and send work requests to that thread, thus having a kind of asynchronous mechanism. Still, your callback/event handler will be waiting for the completion of the operation.

When you mount the file system, you specify a certain timeout that prevents the OS from being blocked forever. If you have a lengthy request, you can call the ResetTimeout method from your callback/event handler in order to extend the time given to your handler for processing. Note, however, that the user-mode process that wanted to read or write the data is waiting and this can cause a negative experience and confusion for the user.

Ready to get started?

Learn more about Callback Technologies or download a free trial.

Download Now