1

When you ask XMLHttpRequest to do an asynchronous work, how many concurrent work could run at the same time?

I am asking this because I use pooling, and my JavaScript is hanging when I open the forth connection. Aka I got 4 asynchronous objects of XMLHttpRequest and they all are doing extremely heavy networking task.

So is there such limitation for the concurrent requests that XMLHttpRequest can handle asynchronously?

Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216

1 Answers1

0

The limit of how many parallel network requests are outstanding is browser-specific and sometimes configurable, but not from within the application. Ofc, you can always use less then allowed.

However, since javascript is single-threaded, unless you use web workers (which is somewhat a different story), then data processing will be serialized. Network requests are running in a parallel threads to the point of getting the data from the network.

Vladimir M
  • 4,403
  • 1
  • 19
  • 24
  • Can you show me when it's configurable? Do you know how it works in Chrome? – Ilya Gazman Sep 20 '16 at 08:29
  • Some times it is possible via browser configuration files or registry. Perhaps this will help: [previous SO on this](http://stackoverflow.com/questions/8404464/increasing-google-chromes-max-connections-per-server-limit-to-more-than-6) – Vladimir M Sep 20 '16 at 08:39