By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,227 Members | 1,175 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,227 IT Pros & Developers. It's quick & easy.

Watch window

P: n/a
What is the most efficient way to get prompted whenever the content of
a memory location has been changed by some other program running the
system.
like my program will intimate me whenever a perticular memory location
content has been modified by any other program or my program itself in
the system ...
thanks in advance
sounak

Dec 26 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
sounak wrote:
What is the most efficient way to get prompted whenever the content of
a memory location has been changed by some other program running the
system.
like my program will intimate me whenever a perticular memory location
content has been modified by any other program or my program itself in
the system ...
thanks in advance
sounak


Cannot be done using ISO C. Ask in a operating system specific group.

Dec 26 '05 #2

P: n/a

"sounak" <so*****@gmail.com> wrote
What is the most efficient way to get prompted whenever the content of
a memory location has been changed by some other program running the
system.
like my program will intimate me whenever a perticular memory location
content has been modified by any other program or my program itself in
the system ...
thanks in advance
sounak

Most modern processors have a "virtual memory system". This means that the
address in a C pointer need not be the same as the physical pulses which are
used to access the memory chip.
So the most efficient solution is to insert a layer between translation of
virtual to physical address, capturing the locations you want. Unfortunately
there is no easy way of doing this, and certainly no way in standard C.
Dec 26 '05 #3

P: n/a
What is the most efficient way to get prompted whenever the content of
a memory location has been changed by some other program running the
system.

So the most efficient solution is to insert a layer between translation of
virtual to physical address, capturing the locations you want. Unfortunately
there is no easy way of doing this, and certainly no way in standard C.


i could have definetly used mailboxes or shared memory to inform my
program but the main problem is that i could not change the code of the
other program who may be changing in the memory location ..
the actual need for this program i will define you properly :
The program which i actually want to design is that
my program will be capable of getting all the information about the
printing activities performed by different machines in the print server
i have designed that my program will sit in the printing port like
512 of the print server .
but it will be inefficient to run a infinite loop to know that any
packets have arrived or not
So it want to have some technique so that my program will automatically

be notified whenever a packects comes into that port ...
now
i was thinking that if somehow i am able to know that the packet has
reached the ports then my program could initiate
like as you think of interupt.
this could save precious CPU usage due to my continously running
program

Dec 27 '05 #4

P: n/a

sounak wrote:
i could have definetly used mailboxes or shared memory to inform my
program but the main problem is that i could not change the code of the
other program who may be changing in the memory location ..
the actual need for this program i will define you properly :
The program which i actually want to design is that
my program will be capable of getting all the information about the
printing activities performed by different machines in the print server
i have designed that my program will sit in the printing port like
512 of the print server .
but it will be inefficient to run a infinite loop to know that any
packets have arrived or not
So it want to have some technique so that my program will automatically

be notified whenever a packects comes into that port ...
now
i was thinking that if somehow i am able to know that the packet has
reached the ports then my program could initiate
like as you think of interupt.
this could save precious CPU usage due to my continously running
program


As mentioned this isn't ANSI C specific. Check the news group for your
operating system. ;-)

Dec 27 '05 #5

P: n/a
"sounak" <so*****@gmail.com> writes:
> What is the most efficient way to get prompted whenever the content of
> a memory location has been changed by some other program running the
> system.


So the most efficient solution is to insert a layer between translation of
virtual to physical address, capturing the locations you want. Unfortunately
there is no easy way of doing this, and certainly no way in standard C.


i could have definetly used mailboxes or shared memory to inform my
program but the main problem is that i could not change the code of the
other program who may be changing in the memory location ..
the actual need for this program i will define you properly :
The program which i actually want to design is that
my program will be capable of getting all the information about the
printing activities performed by different machines in the print server


There's really no way to do this in standard C, which is what we
discuss in this newsgroup. Try a newsgroup that's specific to
whatever system you're using.

I presume you're using the standard workaround for Google's broken
interface, described at <http://cfaj.freeshell.org/google/>, but
please don't snip the attribution lines, the ones that look like
"Poster Name <e-mail address> writes:".

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Dec 27 '05 #6

P: n/a
Then you should have asked that first:
http://www.catb.org/~esr/faqs/smart-questions.html#goal

Your question is still platform-specific, so I'll just suggest that you
look up libpcap. It's a standard, cross-platform library for capturing
network packets.

Dec 27 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.