469,902 Members | 1,949 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,902 developers. It's quick & easy.

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 4581
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Corne Oosthuizen | last post: by
5 posts views Thread by Jeff Weber | last post: by
8 posts views Thread by panko | last post: by
1 post views Thread by jan.loucka | last post: by
2 posts views Thread by Nicolas Le Gland | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.