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

High performance UDP Listener?

I am working on an application that needs a high performance UDP Listener.

Currently I have one thread listening to the network and handling the
requests. Currently I need about 70 MS between packets so I dont drop
anything.

I think I need one thread listening to the network and another thread
handling requests. I dont know if I would need an "array queue" to hold
the messages or if I could just use the RaiseEvent signal to notify the
worker thread to process the inbound message.

Anyone seen a code sample/article that could help me out?

g.
Nov 21 '05 #1
2 4543
I did something very similar before with MSMQ. Does it take much time to
process the incoming UDP requests? If not, you could listen on one thread, as
you said, and simply pass the request to the ThreadPool, using the
QueueUserWorkItem method. If it does take a long time to process a request, I
would not advise using the threadpool as it could become starved quickly. In
this scenario, either create new Thread objects manually (which is the quick
option, but could degrade performance if you have too many threads running at
once, leading to too many context switches), or grab the source for one of
the many custom thread pools out there.

Hope this helps.
Dan

"gregory_may" wrote:
I am working on an application that needs a high performance UDP Listener.

Currently I have one thread listening to the network and handling the
requests. Currently I need about 70 MS between packets so I dont drop
anything.

I think I need one thread listening to the network and another thread
handling requests. I dont know if I would need an "array queue" to hold
the messages or if I could just use the RaiseEvent signal to notify the
worker thread to process the inbound message.

Anyone seen a code sample/article that could help me out?

g.

Nov 21 '05 #2
Processing is probably 50 Ms or so, its pretty quick. I will check out the
QueueUserWorkItem you mentioned. I dont expect I should ever have more than
2-3 threads processing at once.

The other article you mentioned (From my previous post) gave an outline of
using the threadpool, I will give it a try:
http://www.yoda.arachsys.com/csharp/threads/

Thanks!
"Dan Kelley" <Da*******@discussions.microsoft.com> wrote in message
news:A9**********************************@microsof t.com...
I did something very similar before with MSMQ. Does it take much time to
process the incoming UDP requests? If not, you could listen on one thread,
as
you said, and simply pass the request to the ThreadPool, using the
QueueUserWorkItem method. If it does take a long time to process a
request, I
would not advise using the threadpool as it could become starved quickly.
In
this scenario, either create new Thread objects manually (which is the
quick
option, but could degrade performance if you have too many threads running
at
once, leading to too many context switches), or grab the source for one of
the many custom thread pools out there.

Hope this helps.
Dan

"gregory_may" wrote:
I am working on an application that needs a high performance UDP
Listener.

Currently I have one thread listening to the network and handling the
requests. Currently I need about 70 MS between packets so I dont drop
anything.

I think I need one thread listening to the network and another thread
handling requests. I dont know if I would need an "array queue" to hold
the messages or if I could just use the RaiseEvent signal to notify the
worker thread to process the inbound message.

Anyone seen a code sample/article that could help me out?

g.

Nov 21 '05 #3

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

Similar topics

1
by: Cherrish Vaidiyan | last post by:
sir, I have a small error in Listener configuration.I have two system with a database in each. I am using Red Hat 9 and Oracle 9i. so i shall anme the database and system. system 1 - node2 ...
3
by: Bill | last post by:
When vb6 Winsock.RemoteHost is set to "127.0.0.1", c# socket listener cannot hear connect request (my old vb6 winsock listener could hear it...). Why doesn't this work, and is there a work...
10
by: shsandeep | last post by:
The ETL application loaded around 3000 rows in 14 seconds in a Development database while it took 2 hours to load in a UAT database. UAT db is partitioned. Dev db is not partitioned. the...
14
by: ajfish | last post by:
Hi, I am trying to allocate a unique ID to every instance of tag 'foo' in a large XML document. currently I'm doing this: <xsl:variable name="UniqueId"> <xsl:number count="foo" level="any"/>...
5
by: mivey4 | last post by:
Hi, First off, I am aware that this is a very heavily documented error and I have done my homework for throughly researching probable causes before deciding to post my problem here. At this point,...
2
by: Jay Loden | last post by:
All, In studying Python, I have predictably run across quite a bit of talk about the GIL and threading in Python. As my day job, I work with a (mostly Java) application that is heavily threaded....
1
by: Ted | last post by:
I have cross posted this to comp.lang.c++ and to sci.math.num- analysis in the belief that the topic is of interest to some in both groups. I am building my toolkit, in support of my efforts in...
0
by: Michel Esber | last post by:
Hello, Linux RedHat AS4 running DB2 V8 FP15. I have very large tables (100 Million+ rows), and I only need to keep 6 months of data online/available. The tables have a timestamp field. I...
0
by: dotnetrocks | last post by:
Hi, I'm writing a high performance tcp/ip server using IOCP. Recently I found XF.Server component at http://www.kodart.com They claim that it is the fastest server implementation. Is it possible?...
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: 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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.