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

  • Home
  • SEARCH
  • 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 361341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:53:06+00:00 2026-05-12T12:53:06+00:00

Say I have script, that does long polling on server to check if user

  • 0

Say I have script, that does long polling on server to check if user has any new mesages. Server side would be something like this

while counter < 5
    if something_changed
        push_changes_to_client
        break
    else
        counter++
        sleep 5

Which checks database 5 times and every time if there is no change, it waits 5s untill next check, which results in maximum execution time of about 25s.

What happens when client moves from one page to another really fast? I suppose the server script keep on running even after client move to different page, where it sends another request for changes.

Does this mean, that when lot of people are moving quickly around the site (less than the 25s max execution on each page), then the server has to keep running all the scripts, that are trying to respond to page that doesn’t exist any more? Wouldn’t this cause the server to use all of it’s thread pool pretty fast?

  • 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-12T12:53:07+00:00Added an answer on May 12, 2026 at 12:53 pm

    In a thread-per-connection model with synchronous sleep calls, this indeed may tie up a large number of threads. However, if the “sleep” simply schedules a callback and returns, the thread pool logjam can be avoided.

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

Sidebar

Ask A Question

Stats

  • Questions 348k
  • Answers 348k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It sounds like you need a manager class (or something)… May 14, 2026 at 6:33 am
  • Editorial Team
    Editorial Team added an answer What you're doing is fine. Old tricks like SetROP2() don't… May 14, 2026 at 6:33 am
  • Editorial Team
    Editorial Team added an answer So technically a boolean is True (1) or False(0) This… May 14, 2026 at 6:33 am

Related Questions

Preface Let me start off by saying that I'm a relatively new programmer and
I want to ask about manipulating IE via Powershell. My goal is to write
I have a pretty long SQL query that I use to, for all of
I have a C application and I want to include a Scripting Language to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.