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

S

slahiri

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
 
K

Keith Thompson

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

Kenny McCormack

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

Rod Pemberton

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
 
C

Christian Bau

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top