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

Asynchronous vs Synchronous network communication

Hi,
I am a tad confused about if there are any benefits from using
asynchronous vs synchronous network communication.
As my example, I have been writing a dns lookup stack with a network
communication class switchable between asynchronous and synchronous.
When I use asynchronous udp communication I find that if I want to
process a large amount of dns lookups I have one dns provider with
many state objects passing through (and a high object churn rate). If
I use synchronous udp communication I don't need state objects, but
have many providers each in a thread (although these providers are
static and so there is low churn).
It seems to me that both methods amount to the same result other than
the fact that using asynchronous communication results in a higher
object churn rate (leading to higher memory usage).
Can anybody clarify whether there really is an advantage in using one
over the other?

My second question is a bit of a throwaway. Using whatever network
communication, what kind of techniques exist to throttle something
like this based on available bandwidth?

Thanks,
Noel
Jul 21 '05 #1
1 4839
Hi,

For dns probably you won't get any benefit from async.
Where async gives good result ?
For example IMAP, most of time session is just IDLE.
When as sync you have 1 thread for each session, with async you just use
pooled threads if there is some work to do.

"Noel" <no*********@gmail.com> wrote in message
news:2c*************************@posting.google.co m...
Hi,
I am a tad confused about if there are any benefits from using
asynchronous vs synchronous network communication.
As my example, I have been writing a dns lookup stack with a network
communication class switchable between asynchronous and synchronous.
When I use asynchronous udp communication I find that if I want to
process a large amount of dns lookups I have one dns provider with
many state objects passing through (and a high object churn rate). If
I use synchronous udp communication I don't need state objects, but
have many providers each in a thread (although these providers are
static and so there is low churn).
It seems to me that both methods amount to the same result other than
the fact that using asynchronous communication results in a higher
object churn rate (leading to higher memory usage).
Can anybody clarify whether there really is an advantage in using one
over the other?

My second question is a bit of a throwaway. Using whatever network
communication, what kind of techniques exist to throttle something
like this based on available bandwidth?

Thanks,
Noel

Jul 21 '05 #2

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

Similar topics

3
by: Corne Oosthuizen | last post by:
I'm writing a Telnet Server application using Asynchronous sockets. I spawn a listener thread to handel incomming connections and create a separate client socket for each new connection. I...
5
by: Jeff Weber | last post by:
First, my question: Should I use Write or BeginWrite (sync or async) to stream data to my clients over a TCPClient connection. Details: On the server I have a custom circular data buffer that...
3
by: usenetaccount | last post by:
In a newly created test app, to maximize client performance I tried to make two SOAP method calls in tandem (the soap methods execute some specified query), as each call includes a large amount of...
1
by: Noel | last post by:
Hi, I am a tad confused about if there are any benefits from using asynchronous vs synchronous network communication. As my example, I have been writing a dns lookup stack with a network...
8
by: panko | last post by:
Hello, I can't manage with asynchronous socket communication. :( I wrote a class CSocket.cs. This class is taking care of sending strings to LED display. This display is actually communicating...
5
by: HugeBob | last post by:
Hi All, I've got a question about Asynchronous vs Synchronous mode with the XMLHttpRequest object. What are the ramifications of using one mode vs the other? If the script uses Asynchronous...
1
by: jan.loucka | last post by:
I'm developing WinForms application in .NET 2.0 that talks to web service. The automatically generated proxy (reference class) has got methods for both synchronous and asynchronous invocations of...
1
by: jan.loucka | last post by:
I'm developing WinForms application in .NET 2.0 that talks to web service. The automatically generated proxy (reference class) has got methods for both synchronous and asynchronous invocations of...
2
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...
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:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
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: 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.