Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7622215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:23:48+00:00 2026-05-31T04:23:48+00:00

I have an application that will be reading sequenced packets from a udp connection.

  • 0

I have an application that will be reading sequenced packets from a udp connection. These messages need to be stored in some form of buffer with their sequence numbers for lookup.

This ‘buffer’ is serviced by another thread that removes the message and handles it. If a sequence number is missed, I have stop the service thread and then re-request the message on another TCP connection. Once it arrives, I want to plonk it back into the buffer, and the service thread can continue.

So I need : insertions by key, removals by lowest key. The key will be a numerical incrementing number such as 1,2,3,4 so it makes it a bit easier to keep track of the highest number, as the key can thus be incremented/decremented, avoiding the need to sort the datastructure.

My one plan is to use a Dictionary as the buffer, which makes for a simple solution

My other solution uses a set up two queues

Suggestion by zmbg to use SortedList - I am concerned about performance, as hashing would provide faster lookup and insert not?

My questions are:

  • Basically I’m looking for pitfalls in terms of memory or performance using a dictionary for this solution. The machine that will run it doesn’t have too much memory, but throughput performance has a slightly higher priority.
  • If this application is running all day, would there be any memory related issues when using the dictionary?
  • Does anyone have any thoughts on this or alternative implementation of this procedure. I have to decide on a design, but I cannot test different solutions for performance as I don’t quite have enough time, so I thought I’d try a theoretical gathering of ideas and merit of implementation ideas before I start.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:23:49+00:00Added an answer on May 31, 2026 at 4:23 am

    I finally decided to implement my own Queue with a Dictionary backing it.

    Dictionary provides the insertion and removal performance I am looking for, and pondering too much over small performance issues prematurely is not going to get me nowhere.

    Keeping track of the lowest number only is fine, I will not go into too much detail further.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that will accept URLs from the built in web browser
I have a web application that will need to access code behind methods as
I have DLL and application that will call some function in this dll. For
I starting to write an application that will need to have a QR code
I have one application that prints messages from Test.exe in console .My java program
We have an application that will be collecting data and storing it in local
I have an application that will mainly operate in the background. I want certain
I have this application that will recurse all folders in a given directory and
I have an application that requires resizing of a component that will be scaled
I have a console application that will be kicked off with a scheduler. If

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.