473,382 Members | 1,648 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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

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 '06 #1
4 2600
"sl*****@tampabay.rr.com" <sl*****@tampabay.rr.com> 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) 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.
Feb 11 '06 #2
In article <11*********************@z14g2000cwz.googlegroups. com>,
sl*****@tampabay.rr.com <sl*****@tampabay.rr.com> 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.

Feb 11 '06 #3

<sl*****@tampabay.rr.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
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
Feb 11 '06 #4
In article <11*********************@z14g2000cwz.googlegroups. com>,
"sl*****@tampabay.rr.com" <sl*****@tampabay.rr.com> 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.
Feb 11 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: gsb | last post by:
Object tag to write HTML page to via JavaScript? I've used iFrames and Objects to load web pages into another page. I want to do similar but not load a uri, rather write the page, <HTML>...
6
by: Harlan Messinger | last post by:
When a table has multiple layers of column and/or row headings, as we know, there are a couple of options for making the table accessible. Using a *scope* attribute is fine as long as the number of...
1
by: cnu | last post by:
My program generates a log file for every event that happens in the program. So, I open the file and keep it open till the end. This is how I open the file for writing: <CODE> public...
5
by: Sumana | last post by:
Hi All, We developed our project on VC++.Net console application to create image of disk and to write the image We are having problem with reading and writing the sector beyond 6GB Disk or...
5
by: news.microsoft.com | last post by:
Hello, what is the most performant size for the byte array for reading/writing using 2 filestreams? example code: Dim bytearrayinput(4095) As Byte Dim rdlen As Long = 0 Dim totlen As Long...
4
by: UJ | last post by:
What's the easiest/best way to open a single file from multiple applications but so only one can read it at a time? I tried a mutex but had problems. I noticed there is something called a...
6
Atran
by: Atran | last post by:
Hello: In this article: You will learn to Write or Read A Text File. Let's Begin: First Create a new project (ConsoleApp or WinApp). And Make sure your program uses these namespaces: using...
63
by: Bill Cunningham | last post by:
I don't think I can do this without some help or hints. Here is the code I have. #include <stdio.h> #include <stdlib.h> double input(double input) { int count=0,div=0; double...
2
by: Zytan | last post by:
I just had the problem occur again, with NetworkStream.Write() doing its thing with a timeout... and it just sits and waits and waits and waits... it never times outs. So, I shut the server down...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.