473,698 Members | 2,086 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Asynchronous Communications in C#

Greetings everyone!

This is a fairly broard question.. But should be enough to suffice for an
answer. Currently we are making an entreprise database server. We will be
using C# - my question is this - is Asynchronous Programming in C#
sufficient for production grade quality? If so - does anyone know where to
find out how many concurrent connections can be reached (although dependant
on their data transfered)?

Any information in regards to this would be greatly appreciated!

--
Regards,
Daniel Rodriguez
Animusoft Corporation
http://www.animusoft.com


Nov 15 '05 #1
5 2088

"Daniel J Rodriguez" <Danny from the Animusoft Corporation> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Greetings everyone!

This is a fairly broard question.. But should be enough to suffice for an
answer. Currently we are making an entreprise database server. We will be
using C# - my question is this - is Asynchronous Programming in C#
sufficient for production grade quality? If so - does anyone know where to
find out how many concurrent connections can be reached (although dependant on their data transfered)?

Any information in regards to this would be greatly appreciated!


Neither Sql Server nor Oracle uses asyncronous I/O for client connections.
Both spawn a thread for each client connection. And Oracle doesn't even
have any asyncronous I/O on many platforms. So I'm not sure that
asyncronous I/O is even necessary.

Asyncronous I/O is necessary when you measure your clients in the thousands,
like for a web server. Database servers usually measure clients in the
hundreds, and threads will generally suffice in this range.

David

David
Nov 15 '05 #2
Hrmm interesting...

Here is another question then - my first attempt to handling incoming
connections for the database server was to create a thread for each
connection.. After further reading I found that the Asynchronous method used
threading itself.. It uses thread pooling to handle the requests.. Moveover,
it seemed to be more responsive than the latter..

Do you have more comments on this? I would really like to know what you
think..

Regards,

Daniel J Rodriguez
Animusoft Corporation
www.animusoft.com
"David Browne" <davidbaxterbro wne no potted me**@hotmail.co m> wrote in
message news:%2******** ********@tk2msf tngp13.phx.gbl. ..

"Daniel J Rodriguez" <Danny from the Animusoft Corporation> wrote in message news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Greetings everyone!

This is a fairly broard question.. But should be enough to suffice for an answer. Currently we are making an entreprise database server. We will be using C# - my question is this - is Asynchronous Programming in C#
sufficient for production grade quality? If so - does anyone know where to find out how many concurrent connections can be reached (although dependant
on their data transfered)?

Any information in regards to this would be greatly appreciated!


Neither Sql Server nor Oracle uses asyncronous I/O for client connections.
Both spawn a thread for each client connection. And Oracle doesn't even
have any asyncronous I/O on many platforms. So I'm not sure that
asyncronous I/O is even necessary.

Asyncronous I/O is necessary when you measure your clients in the

thousands, like for a web server. Database servers usually measure clients in the
hundreds, and threads will generally suffice in this range.

David

David

Nov 15 '05 #3

"Daniel J Rodriguez" <Danny from the Animusoft Corporation> wrote in message
news:ek******** ******@tk2msftn gp13.phx.gbl...
Hrmm interesting...

Here is another question then - my first attempt to handling incoming
connections for the database server was to create a thread for each
connection.. After further reading I found that the Asynchronous method used threading itself.. It uses thread pooling to handle the requests.. Moveover, it seemed to be more responsive than the latter..

Do you have more comments on this? I would really like to know what you
think..


There are 2 places you have to decide between blocking I/O with slave
threads and async I/O using thread pools. The listener and the client
session. For the listener, there's no real reason to use async I/O since
you only need one thread, and it's just simpler. So the listener just
accepts the connection and passes it off to a background thread.

For the client connections async I/O has better scalability, but at the cost
of a substantially more complicated programming model, making your system
harder to implement, instrument, manage and change. So for client sessions
I would move away from dedicated slave threads for each client only if I had
to.

David
Nov 15 '05 #4
I am a bit confused as to what you are trying to say.. Are you saying to use
a combination of the two? To use the slave thread to listen and then use
async to communicate between the client and server - once the connection has
been established from the listener?
"David Browne" <davidbaxterbro wne no potted me**@hotmail.co m> wrote in
message news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..

"Daniel J Rodriguez" <Danny from the Animusoft Corporation> wrote in message news:ek******** ******@tk2msftn gp13.phx.gbl...
Hrmm interesting...

Here is another question then - my first attempt to handling incoming
connections for the database server was to create a thread for each
connection.. After further reading I found that the Asynchronous method used
threading itself.. It uses thread pooling to handle the requests..

Moveover,
it seemed to be more responsive than the latter..

Do you have more comments on this? I would really like to know what you
think..


There are 2 places you have to decide between blocking I/O with slave
threads and async I/O using thread pools. The listener and the client
session. For the listener, there's no real reason to use async I/O since
you only need one thread, and it's just simpler. So the listener just
accepts the connection and passes it off to a background thread.

For the client connections async I/O has better scalability, but at the

cost of a substantially more complicated programming model, making your system
harder to implement, instrument, manage and change. So for client sessions I would move away from dedicated slave threads for each client only if I had to.

David

Nov 15 '05 #5

"Daniel J Rodriguez" <Danny from the Animusoft Corporation> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I am a bit confused as to what you are trying to say.. Are you saying to use a combination of the two? To use the slave thread to listen and then use
async to communicate between the client and server - once the connection has been established from the listener?


That's one way to go. But I would recommend to use a slave thread to listen
and a slave thread for each connection. If your connections are
short-lived, you might want to pool your slave threads to save on the
overhead of creation of new threads.

David
Nov 15 '05 #6

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

Similar topics

6
2932
by: Zunbeltz Izaola | last post by:
Hi, I have the following problem. I'm developing a GUI program (wxPython). This program has to comunicate (TCP) whit other program that controls a laboratory machine to do a measurement. I have a dialog box, wiht two buttoms "Start measurement" and "Stop". "Start" executes a function that do the measurement in the following way.
0
2497
by: Dana Morris | last post by:
Call for Participation OMG's First Annual Software-Based Communications (SBC) Workshop: From Mobile to Agile Communications http://www.omg.org/news/meetings/SBC2004/call.htm September 13-16, 2004 Washington, DC USA Introduction
1
1491
by: Catherine Jo Morgan | last post by:
This is for a recreational tree climbing database. When a climb is arranged, it often begins with one or more inquiries by phone or email. Sometimes it takes several communications to answer questions, set dates, etc. At some point an inquiry gets definite enough to become a JobProposal, with a specific type of climb, dates and fee set, etc. Usually JobProposals become Climbs when the inquirer signs a contract, pays the deposit or fee,...
6
6978
by: Peter Krikelis | last post by:
Hi All, I am having a problem setting up input mode for serial communications. (Sorry about the long code post). The following code is what I use to set up my comm port.
1
1549
by: Julian Hershel | last post by:
Reading about asynchronous programming (ms-help://MS.NETFrameworkSDK/cpguidenf/html/cpconasynchronousdesignpatterno verview.htm) I could not clarify some doubts. Hope you can help me. 1) Are asynchronous programming and multithreaded programming two different pictures? As I read the help topic above it is not clear to me if the design pattern opens a new thread or not to run the methods asynchronously. 2) One unique thread can run...
4
2987
by: Gary Frank | last post by:
I'd like to write a program in VB.Net that handles serial communications to several devices. VB.Net 2003 does not have adequate built-in serial communications. I heard that 2005 will have that. Has this serial communications functionality been built into 2005 Beta yet? If so, is there any reason I can't get the Beta and create the program with serial communications now?
1
2872
by: dba123 | last post by:
I need to perform Asynchronous Inserts using DAAB. So far I have a method which does an insert but how can I do this Asyncronously so that it does not affect the load on our public production website? This question is wide open but make sure you give me some ideas in context with DAAB syntax. Some thoughts are threading, ATLAS, etc. but I have no clue how to even approach an Asynchronous Insert or any techniques at this point. Also, I...
0
1753
by: Bishoy George | last post by:
Hi, I have a asp.net 2.0 web application. I want to implement the asynchronous model through http handler in web.config ------------------------------------------------------------------------------------------------------------------------- My web.config file: ---------------------
2
3428
by: Nicolas Le Gland | last post by:
Hello everyone here. This is my first post in this newsgroup, I hope I won't be to much off-topic. Feel free to redirect me to any better group. I am getting strange timing issues when failing to asynchronously connect sockets on closed or filtered ports, but I'm quite unsure if this is a PHP issue or my misunderstanding, as it seems that socket streams only wrap around <sys/socket.h>.
0
8672
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8600
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9155
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8858
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4360
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4614
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
1997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.