dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: shared memory in C

  1. #1
    naomi Guest

    shared memory in C


    DOes any one have a simple example or know where I might find a simple example
    of using shared memory in C. I have one process that keeps a counter of
    something and another program that when run needs to be able to spit out
    this number.
    Thanks for any help you can give me.
    Naomi

  2. #2
    ralph Guest

    Re: shared memory in C


    "naomi" <n.codlin@student.qut.edu.au> wrote:
    >
    >DOes any one have a simple example or know where I might find a simple example
    >of using shared memory in C. I have one process that keeps a counter of
    >something and another program that when run needs to be able to spit out
    >this number.
    >Thanks for any help you can give me.
    >Naomi


    "Shared memory" between processes is entirely O/S dependent. You need to
    tell us the operating system you are working with.

    There are also many different methods for processes to "share" information.
    It may be that "shared memory" is not necessary the best technology for the
    solution you need.



  3. #3
    naomi Guest

    Re: shared memory in C


    "ralph" <nt_consulting32@hotmail.com> wrote:
    >
    >"naomi" <n.codlin@student.qut.edu.au> wrote:
    >>
    >>DOes any one have a simple example or know where I might find a simple

    example
    >>of using shared memory in C. I have one process that keeps a counter of
    >>something and another program that when run needs to be able to spit out
    >>this number.
    >>Thanks for any help you can give me.
    >>Naomi

    >
    >"Shared memory" between processes is entirely O/S dependent. You need to
    >tell us the operating system you are working with.
    >
    >There are also many different methods for processes to "share" information.
    >It may be that "shared memory" is not necessary the best technology for

    the
    >solution you need.
    >
    >

    It's on a Linux box. I found a good example so that's not the problem.
    However I am open to any other suggestions or alternative solutions.

    I have a large program which previously read data from a port. The stallion
    stats program was used to keep track of how much data was coming over the
    ports.
    I have had to change this program to read from a telnet connection instead.
    What I need is a very simple executable that can reset a counter and display
    how much data is being read. We were considering keeping a counter in the
    main program that could be accessed be the other executable using shared
    memory.

    Any suggestions would be greatly appreciated.

    Naomi

  4. #4
    Miron Guest

    Re: shared memory in C


    "naomi" <n.codlin@student.qut.edu.au> wrote:
    >
    >"ralph" <nt_consulting32@hotmail.com> wrote:
    >>
    >>"naomi" <n.codlin@student.qut.edu.au> wrote:
    >>>
    >>>DOes any one have a simple example or know where I might find a simple

    >example
    >>>of using shared memory in C. I have one process that keeps a counter

    of
    >>>something and another program that when run needs to be able to spit out
    >>>this number.
    >>>Thanks for any help you can give me.
    >>>Naomi

    >>
    >>"Shared memory" between processes is entirely O/S dependent. You need to
    >>tell us the operating system you are working with.
    >>
    >>There are also many different methods for processes to "share" information.
    >>It may be that "shared memory" is not necessary the best technology for

    >the
    >>solution you need.
    >>
    >>

    >It's on a Linux box. I found a good example so that's not the problem.


    >However I am open to any other suggestions or alternative solutions.
    >
    >I have a large program which previously read data from a port. The stallion
    >stats program was used to keep track of how much data was coming over the
    >ports.
    >I have had to change this program to read from a telnet connection instead.
    > What I need is a very simple executable that can reset a counter and display
    >how much data is being read. We were considering keeping a counter in the
    >main program that could be accessed be the other executable using shared
    >memory.
    >
    >Any suggestions would be greatly appreciated.
    >
    >Naomi


    Using a database comes to my mind first. A database such as MySQL will work
    great. And it is ready to go right out of the box. By the way it can be accessed
    from a remote machine and the interface is all written, debugged, and ready
    to go.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center