EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Notification timing

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#28602
Posted: 02/27/2014 05:27:40
by Cedric Mamo (Standard support level)
Joined: 12/02/2013
Posts: 14

Example: suppose my program can process 1000 notifications per second, but there happens to be a lot of io on the disk. My program can't process them fast enough for a period of time. It is my understanding that callbackfilter caches these in memory and then keeps giving me the notifications as fast as I can process them.

Unfortunately the notifications don't have information about the time that the event occurred.

Is there any way to ensure that there are no notifications still queued that happened before a particular time. For example, i want to make sure I have processed every single notification that happened before 1pm. As far as I can see (unless I have missed something of course) I can't guarantee that, for the simple reason that I don't know if there is anything queued on the filter that I haven't processed yet.

And assuming that the heavy io is still there, I wouldn't know which notifications I should assume came before or after the specific time
#28603
Posted: 02/27/2014 05:55:25
by Vladimir Cherniga (EldoS Corp.)

Quote
Is there any way to ensure that there are no notifications still queued that happened before a particular time.

Unfortunately, there is no way to dequeue notifications, in other way than terminating filtering. In that case all queued callbacks will be terminated. The only way to affect on callbacks timing, by using CallbackFilter.ResetTimeout() api. In that way you can change a timeout value of queued callbacks termination.
#28604
Posted: 02/27/2014 06:02:18
by Cedric Mamo (Standard support level)
Joined: 12/02/2013
Posts: 14

On the contrary the thing I *must* not do is terminate any notifications. In fact all I want to do is ensure I got all of them.

To use the same example: I want to ensure that there aren't any notifications left to dequeue that originally happened before 1pm.

Suppose I get 1000 notifications at 12:59:59.500. At the rate my program can go (1000 notifications per second, as in the example in my previous post), it will finish processing them all at 13:00:00.500

Suppose I get another 1000 notifications at 13:00:00.000

My problem is that I don't know when I've actually finished processing those that happened before 1pm and started processing those that happened after 1pm
#28606
Posted: 02/27/2014 06:06:15
by Eugene Mayevski (EldoS Corp.)

Quote
Cedric Mamo wrote:
My problem is that I don't know when I've actually finished processing those that happened before 1pm and started processing those that happened after 1pm


Can you describe the purpose of knowing this? While we can potentially add some time-related information to notifications, but maybe it would be more correct to use synchronous callbacks in your case -- and you in your application can arrange your own notification queue then (and process those callbacks/notifications asynchronously).


Sincerely yours
Eugene Mayevski
#28607
Posted: 02/27/2014 06:06:40
by Cedric Mamo (Standard support level)
Joined: 12/02/2013
Posts: 14

To put it another way, I can't find a way of knowing if a notification means "an event just happened" or "an event happened 2 seconds ago"
#28608
Posted: 02/27/2014 06:08:31
by Cedric Mamo (Standard support level)
Joined: 12/02/2013
Posts: 14

And all i'm doing in my callback is pushing it onto a queue, which is being processed asynchronously in another thread
#28610
Posted: 02/27/2014 06:12:03
by Eugene Mayevski (EldoS Corp.)

And this is what you can do in synchronous callback as well - no significant difference here.


Sincerely yours
Eugene Mayevski
#28611
Posted: 02/27/2014 06:15:42
by Vladimir Cherniga (EldoS Corp.)

You may try to manipulate with filter rules, adding/removing them in a certain time.
#28612
Posted: 02/27/2014 06:29:29
by Cedric Mamo (Standard support level)
Joined: 12/02/2013
Posts: 14

My test code does the following:

it sets up a synchronous callback on a file
it writes 2 bytes at different positions in the file
it calls Flush on the file (which blocks until everything has been written to disk)
it then checks whether I've received the callbacks for both positions I wrote to in the file.

The test consistently fails.

The thing is that I do get the callbacks, but they're late. Flush() is a blocking call until everything is written to disk, and a callback is synchronous, so I should have received them by the time Flush() returns.

What's more I even enabled ProcessCachedReadWriteCallbacks on the filter and I still get the callbacks too late
#28613
Posted: 02/27/2014 06:35:49
by Vladimir Cherniga (EldoS Corp.)

What is parameters used in file open ? What is the exact code for Flush() ?
Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.

Reply

Statistics

Topic viewed 6078 times

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




|

Back to top

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

Got it!