Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Watch window

Reply
Thread Tools

Watch window

 
 
sounak
Guest
Posts: n/a
 
      12-26-2005
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

 
Reply With Quote
 
 
 
 
Giannis Papadopoulos
Guest
Posts: n/a
 
      12-26-2005
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.

 
Reply With Quote
 
 
 
 
Malcolm
Guest
Posts: n/a
 
      12-26-2005

"sounak" <(E-Mail Removed)> 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.


 
Reply With Quote
 
sounak
Guest
Posts: n/a
 
      12-27-2005

> > 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

 
Reply With Quote
 
D.Hering
Guest
Posts: n/a
 
      12-27-2005

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.

 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      12-27-2005
"sounak" <(E-Mail Removed)> 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) http://www.velocityreviews.com/forums/(E-Mail Removed) <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.
 
Reply With Quote
 
nickptar
Guest
Posts: n/a
 
      12-27-2005
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating custom Watch window in ASP.Net Ashishthaps ASP .Net Building Controls 0 08-20-2005 08:46 PM
Own your famous brand watch rooney Firefox 0 04-20-2005 05:58 AM
window to window communication (window.opener) Andrew Bewley via DotNetMonster.com ASP .Net 0 02-03-2005 12:59 PM
Watch thread? William W. Plummer Firefox 3 07-16-2004 08:33 AM



Advertisments