CallbackFilter

Instant control over file and folder operations in Windows and .NET applications

Thread safety and serialization of the calls

Callback functions are always serialized when they are related to the same file. In other words, if there are two write or read operations on the same file, the callback functions are called first for the first operation, then, after the first callback has returned, for the next operation and so on. The calls are performed by the same thread.

However if there are two pending operations for different files, the callbacks can be called in two ways - either serialized (as described above) or in parallel from several different threads (the number of threads is determined by MinWorkerThreadCount and MaxWorkerThreadCount properties). The default behaviour is to call the callbacks in parallel, and this can be changed to sequential call using SerializeCallbacks property.

In any case, the callbacks are not called within context of the thread, in which the component itself was created. So you would need to synchronize the operations between the callbacks and the operations in other threads of the application.

Back to top