473,401 Members | 2,139 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,401 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 4840
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...
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.