473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Event Notification in C++

ashitpro
542 Expert 512MB
Hi there,

I am working on a distributed service detection project, written in C/C++
Platform is Linux. Each system under network has mysql database for general storage. If first node queries to second node and if request gets satisfied, First node will put these results in its local cache table. So whenever same query gets fired on first node, it would just return the results from its cache table.
The problem arises when second node changes his database table.
First node should get notified that its cache has got dirty.
This is the classical problem of "Dirty Cache Detection".
One solution would be, Each node will store the information of the system whom did he serve. And whenever local database changes, it'd send the message to the other system, notifying that you can clear your cache.
There will be thousands of nodes and above solution will increase the network traffic terribly.
Give me some algorithm or any existing library for this event notification(must be efficient).

NOTE:My English is weak. So let me know if you don't understand the problem.

Regards,
Ash
Nov 18 '08 #1
1 4428
weaknessforcats
9,208 Expert Mod 8TB
This is the classic Observer design pattern.

This pattern is based on a Notify/Publish scenario where an object (your second node) has to notify interested observers (your first node) that the state of the database has changed. The first node then publishes new results by doing a re-query.

If there are many observers, then a Mediator becomes involved where the Mediator is notified and it int turn notitifes all of the observers.

Check out Design Patterns by Eric Gamma, et al. ISBN0-201-63361-2 page 293. All the examples are in C++.
Nov 18 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: coder_1024 | last post by:
I've embedded an ActiveX/COM object in my web page (i.e. <OBJECT ID="MyObject1 ...> ... </OBJECT>). I know I can access the object using javascript on the page (i.e. MyObject1.property or...
2
by: dubian | last post by:
I would like to propagate an event signal to an external application when a table in my MSSql2000 server is updated. Prog A; I have an external application adding records to a table. Prog B; I...
1
by: zfeld | last post by:
I need an event notification when the user types anything in the combobox textfield? I know about the TextChanged Event but the problem is this is also fired when the user selects an item in the...
4
by: Charles Law | last post by:
Is there an event or notification that my application can receive when a USB device (or other) is plugged in? I have looked at WMI as this appears to be the right area but cannot see how to get...
3
by: SB | last post by:
Having gone through couple of books on .NET web services, I could not find any details event notification. They all cover in detail the coomon request/response web services implementation. I would...
1
by: barbara_dave | last post by:
Hi all, I want do Event/Notification when a USB device plugged in. I am working on a Windows 2000 computer. Is there a way to do that? Thanks a lot!
3
by: geskerrett | last post by:
We have been asked to develop and application for a client that is a 'notification" system. We would like to use python, but are struggling to find the right starting point. Any suggestions, tips...
0
by: anitajose | last post by:
Hi, I have a PHP program and a VC++ program. Is it possible, when i click on a button in PHP user screen, I should get an event notification in VC++ service program and do the appropriate action...
0
by: sanakausar | last post by:
Hi I am working on a web application which is a sort of bidding portal where buyer post their jobs and the service provider bid against them. The application is being developed using EF 4.0 , .Net...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.