EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Disabling serialized access to a single file?

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
Posted: 03/27/2012 15:18:46
by Andy Hickmott (Basic support level)
Joined: 03/27/2012
Posts: 9

I'm evaluating CallbackFilter for a product I'm working on, and have run into some questions.

Is there any way to keep CallbackFilter from serializing access to a single file?

I see the SetSerializeCallbacks(false) call - that's not what I'm looking for, as far as I can tell. If I'm reading the CallbackFilter documentation right, even with that set, all access to a single file, including overlapped I/O, is serialized in a single thread in the filter. Is there any way around that?

More detail on what I'm trying to do:

I'm implementing something that provides data in a file on a just-in-time basis.

Executable A (which I didn't write and can't change) is reading data from a file. Executable B (which I am writing now) is trying to write data to the same file just in time for Executable A to read it. Eventually A tries to read something that B hasn't written yet. I need the OnReadFileC for A's read to block while B obtains the data and writes it to the file. Unfortunately, since access to the file is serialized, B's write blocks until A's read completes, resulting in a deadlock. Any thoughts?

In addition, as a separate use case, one potential Executable A makes heavy use of read-only overlapped I/O for performance reasons - it's a game doing 3D rendering, and it sets up many parallel reads for scene texture information from a single master texture file; serializing them degrades performance considerably. Anything I can do about that?

Andy Hickmott
Posted: 03/27/2012 16:59:21
by Vladimir Cherniga (Team)

Did you try to use several CallbackFilter instances simultaneously ? You may create up to 256 filters.
Posted: 03/28/2012 09:07:21
by Andy Hickmott (Basic support level)
Joined: 03/27/2012
Posts: 9

So for the first use case, I could set up separate read and write filters? I'll try that.

I don't quite see how that would work in the second use case. Wouldn't the filters stack in series, so that blocking a read request anywhere in the stack would effectively block any subsequent reads at the same layer? Or could I reset the FltCallbackFlag on the first filter when it blocks - would that actually work?
Posted: 03/28/2012 10:31:11
by Vladimir Cherniga (Team)

Or could I reset the FltCallbackFlag on the first filter when it blocks - would that actually work?
It could possibly works , but unknown number of threads may be blocked, waiting for read access on first filter, until it will be reset. Would it be possible to satisfy read request, obtaining missing data inside blocked read callback ?



Topic viewed 2320 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!