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 6740525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:36:58+00:00 2026-05-26T11:36:58+00:00

I have a Queuing Theory problem where following are to be done: Develop a

  • 0

I have a “Queuing Theory” problem where following are to be done:

  • Develop a CLIENT to send continuous packets of fixed size to SERVER at fixed rate
  • SERVER has to queue these packets and SORT them before handling these packets
  • Then we need to prove (for some packet size ‘n’ bytes and rate ‘r’ MBps) the theoretical observation that sorting(n log n / CPU_FREQ) happens faster than queuing (n / r), and thus the QUEUE should not build up at all.

However, I find that Queue is always building up (running on two systems – client and server PCs/Laptops),

Note: When I run the processes on the same system, then Queue doesnt build and most of the time, it is down close to 1 – 20 packets.

Need someone to check/review my code.

Code is pasted here:

  1. Client (Single Class):

    • Main: http://pastebin.com/embed_iframe.php?i=YEfQGXFZ
  2. Server (Multiple Class files Package: serverClasses:

    • Main: http://pastebin.com/embed_iframe.php?i=BgZzfiTQ
    • Sorting: http://pastebin.com/embed_iframe.php?i=mPh8zgqC
    • ServerThreadPerClient: http://pastebin.com/embed_iframe.php?i=ZpTqpHnX
    • GlobalStatistics: http://pastebin.com/embed_iframe.php?i=Q2DJLvaV
  3. Sample Graph for “QUEUE_LEN Vs. #PACKETS” for 10MBps and 10000 Byte sized packets for a duration of 30 – 35 secs

enter image description here

  • 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-26T11:36:59+00:00Added an answer on May 26, 2026 at 11:36 am

    On the client it looks to me that the timeinterval is always going to be 0. Was that the intension? You say seconds in the code but you are missing the * 1000.

    timeInterval = 1 / ( noOfPacketsToBeSent );
    

    And then you call Thread.sleep((long) timeinterval). Since sleep() takes long then this will at most sleep 1ms and usually (I suspect) sleep 0ms. Sleep only has a millisecond resolution. If you want nanoseconds resolution then you’ll have to do something like:

       TimeUnit timeUnit = TimeUnit.NANOSECONDS;
       ...
       timeUnit.sleep(50);  
    

    I suspect that your CPU is limiting your runs when both the client and the server are on the same box. When they are on different boxes then things back up because the client is in effect flooding the server because of the improper sleep times.

    That’s my best guess at least.

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

Sidebar

Related Questions

I currently have a client website on the Grid server on MediaTemple that will
I am studying queuing theory in which I am frequently presented with the following
I have a queuing mechanism in C on Unix. It accepts XML transactions. Some
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have you managed to get Aptana Studio debugging to work? I tried following this,
I have an incremental index on a shared hosting server. I would have used
I have used Quartz.Net for queuing and sending emails from my application. I don't
Does anyone have good links on how/when/why to use job queuing to scale web
I have the following animations: $('#id').animate({'margin-top': 100, 'margin-left': 100}, {queue: false, duration: 1000}); $('#id2').fadeTo(1000,
i have a construct like the following: os.mkfifo('pipe.tmp') enc = Popen(['encoder', '-i', 'pipe.tmp']) cap

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.