473,387 Members | 1,890 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,387 software developers and data experts.

Reading Stream using Threading ??

Hi All,

Client/Server Program using Sockets...

Server sends request in form of CSV format in NetworkStream...
So I want to read this using threading because it is in very large volume
so threading is faster for that....

But how I read stream using threading...?
or any other suggestion...

Thanx & Regards
--
Ather Murtuzapurwala
Software Engineer
Mumbai,India

A man of trial is a man of success

Nov 16 '05 #1
2 1692
Hi
So I want to read this using threading because it is in very large volume
so threading is faster for that....


Since when did this happen? An common misunderstanding is to say that
threading is faster.
This was not true in the past, this is not true in the current and I'm not
sure for the future. But my guess is as good as any other. Threading is
often introduced when the developer choose the wrong algorithm or structure.

A csv parser should not be slow. Optimize your routine, read about
stringbuilder, fixed, ... Make your routine fast (or search one) and you
don't need threading. When you stay single threaded, you will have a
million bugs less.

kind regards

Alexander



Nov 16 '05 #2
Hi Alexander Muylaert,

Thanx for quick reply & sorry for delay from my side....

Ur ans abt multithreding is very awesome....

Thanx its very useful....

If u have any good link or code abt csv parser then pls mail to me or send
in this group...

Thanx ...
Ather

"Alexander Muylaert" wrote:
Hi
So I want to read this using threading because it is in very large volume
so threading is faster for that....


Since when did this happen? An common misunderstanding is to say that
threading is faster.
This was not true in the past, this is not true in the current and I'm not
sure for the future. But my guess is as good as any other. Threading is
often introduced when the developer choose the wrong algorithm or structure.

A csv parser should not be slow. Optimize your routine, read about
stringbuilder, fixed, ... Make your routine fast (or search one) and you
don't need threading. When you stay single threaded, you will have a
million bugs less.

kind regards

Alexander




Nov 16 '05 #3

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

Similar topics

24
by: Hendrik Schober | last post by:
Hi, I have a 'std::istream' and need to read its whole contents into a string. How can I do this? TIA; Schobi
21
by: JoKur | last post by:
Hello, First let me tell you that I'm very new to C# and learning as I go. I'm trying to write a client application to communicate with a server (that I didn't write). Each message from the...
3
by: Alex Clark | last post by:
Hi All, I'm having some problems reading a network stream. I'm writing a lightweight POP client to handle a very specific task, but I keep unexpectedly reaching the end of the datastream when...
5
by: Dave A | last post by:
I have an application that does lots of socket communications all asynchronously via the TcpClient class. The code has been working 99.9999% of the time (yeah one of those bugs) but occasionally...
2
by: Joe | last post by:
Anyone can suggest the best method of reading XML and adding data to ListView? Here is the xml data structure:: <xml> <site> <url>http://www.yahoo.com</url> <lastupdate></lastupdate>...
9
by: Macca | last post by:
Hi, I have a synchronous socket server which my app uses to read data from clients. To test this I have a simulated client that sends 100 byte packets. I have set up the socket server so...
10
by: John Kraft | last post by:
Hello all, I'm experiencing some, imo, strange behavior with the StreamReader object I am using in the code below. Summary is that I am downloading a file from a website and saving it to disk...
3
by: rsk | last post by:
Hi Friends, I have the following code which reads the hexadecimal data from the "data.txt" file into the arrays. But when i run this code it is reading some garbage data after reading all the...
2
by: =?Utf-8?B?VHJlY2l1cw==?= | last post by:
Hello, Newsgroupians: In regards to reading a stream, I know we use the Read() method. One could implement reading a stream using a while-loop. while (stream.Read(buffer, 0, buffer.Length) !=...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.