How can I write highly optimized C code for reading and writing?

Discussion in 'C Programming' started by slahiri@tampabay.rr.com, Feb 11, 2006.

  1. Guest

    I am writing an I/O utility in C that accepts requests over a socket
    connection and persists the data that can be read by other processes.
    There could be data coming from hundreds of client programs
    simultaneously and my program has to accept and persist these data as
    fast as possible. I am planning to use a memory mapped file for this
    purpose. But do you know any other scheme which will provide a faster
    processing speed? Any help would be greatly appreciated.

    Thanks in advance.

    Sandip
    , Feb 11, 2006
    #1
    1. Advertising

  2. Re: How can I write highly optimized C code for reading andwriting?

    "" <> writes:
    > I am writing an I/O utility in C that accepts requests over a socket
    > connection and persists the data that can be read by other processes.
    > There could be data coming from hundreds of client programs
    > simultaneously and my program has to accept and persist these data as
    > fast as possible. I am planning to use a memory mapped file for this
    > purpose. But do you know any other scheme which will provide a faster
    > processing speed? Any help would be greatly appreciated.


    Standard C doesn't include support for sockets, memory mapped files,
    or any kind of interprocess communication. You'll get better
    information in a newsgroup that's specific to your system, perhaps
    comp.unix.programmer.

    --
    Keith Thompson (The_Other_Keith) <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.
    Keith Thompson, Feb 11, 2006
    #2
    1. Advertising

  3. In article <>,
    <> wrote:
    >I am writing an I/O utility in C that accepts requests over a socket
    >connection and persists the data that can be read by other processes.
    >There could be data coming from hundreds of client programs
    >simultaneously and my program has to accept and persist these data as
    >fast as possible. I am planning to use a memory mapped file for this
    >purpose. But do you know any other scheme which will provide a faster
    >processing speed? Any help would be greatly appreciated.


    Allow me to be the first to say this - and I say it from the deepness of my
    heart, with all the kindness and love one has come to associate with the
    helpful posts you get in this newsgroup:

    Not portable. Can't discuss it here. Blah, blah, blah.
    Kenny McCormack, Feb 11, 2006
    #3
  4. <> wrote in message
    news:...
    > I am writing an I/O utility in C that accepts requests over a socket
    > connection and persists[sic, provides?] the data that can be read by other

    processes.
    > There could be data coming from hundreds of client programs
    > simultaneously and my program has to accept and persist[sic] these data as
    > fast as possible. I am planning to use a memory mapped file for this
    > purpose. But do you know any other scheme which will provide a faster
    > processing speed? Any help would be greatly appreciated.


    Yes, memory mapped data or a ramdisk would provide the fastest access other
    than a solid-state disk drive. However, you could look or ask for
    information on linked-lists or methods of hashing. These techniques might
    be useful in reducing the time to access a large number of records or data
    structures.


    Rod Pemberton
    Rod Pemberton, Feb 11, 2006
    #4
  5. In article <>,
    "" <> wrote:

    > I am writing an I/O utility in C that accepts requests over a socket
    > connection and persists the data that can be read by other processes.
    > There could be data coming from hundreds of client programs
    > simultaneously and my program has to accept and persist these data as
    > fast as possible. I am planning to use a memory mapped file for this
    > purpose. But do you know any other scheme which will provide a faster
    > processing speed? Any help would be greatly appreciated.


    Seems like one of those things where the best you can do is hire an
    experienced programmer.
    Christian Bau, Feb 11, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike
    Replies:
    4
    Views:
    868
    Bob Foster
    Nov 23, 2003
  2. tarverlee
    Replies:
    11
    Views:
    580
    PeterMcC
    Aug 1, 2006
  3. Max2006
    Replies:
    6
    Views:
    488
    Steven Cheng[MSFT]
    Aug 22, 2007
  4. kr
    Replies:
    18
    Views:
    1,234
    Malcolm McLean
    Oct 1, 2007
  5. Replies:
    106
    Views:
    2,048
    Antoninus Twink
    Sep 29, 2008
Loading...

Share This Page