Why does the system become slow if I perform lengthy operations in OnOpenFile, OnCreateFile, or OnCloseFile?

CBFS Connect processes requests in several threads parallely. This lets you achieve optimal performance. However, the creation and closing of the files requires access to certain FS-wide structures and resources. Such access can't be performed from several threads at the same time. So the guard lock is used to serialize access to those resources.

To put it simply, when you handle OnOpenFile, OnCreateFile, or OnCloseFile in one thread, attempts to open or close some other files will be blocked until your handler finishes processing the callback/event.

Conclusion: Make the above-mentioned callback/event handlers as fast as possible. In most cases, all the processing of the OnCloseFile callback/event handler can be moved to another (worker) thread and so can many operations performed in OnOpenFile/OnCreateFile.

Ready to get started?

Learn more about Callback Technologies or download a free trial.

Download Now