Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multithreading limitation

 
Francesco Valle
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I use the occasion of the presentation of the book from Ido Green to ask something I always wanted to know! (Maybe for some of you it will be very easy, sorry for this!)
How many threads it is possible to run at the same time? There is a prefixed limit, or it depends on the server/client resources?
Given that at the moment several web-sites are really heavy (they needs really a lot of RAM due to JavaScript and jQuery scripts, you need simply to open 3 or 4 web-sites at the same time), don't you think it would be dangerous using multithreads in JavaScript without any limitation?

Thank you and bye,
Francesco
 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I second this question, and I think it would also be great to find out how it varies between browsers as well. I love firefox because of all its plugins and extensions, but my guess is that it's a real memory hog, especially if you start multi-threading. But is Chrome, IE, Safari etc any better?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on memory available, Bug report with Chrome: http://code.google.com/p/chromium/issues/detail?id=127990

Eric
 
Francesco Valle
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eric Pascarello wrote:Depends on memory available, Bug report with Chrome: http://code.google.com/p/chromium/issues/detail?id=127990

Eric


So it depends on the client only (supposing we are not killing the server with our calls, obviously! )!
This means that if I deploy a new website that uses multithreading, I have to pay attention to the client (I should have different limits in case the user uses Chrome, Firefox, Explorer, or it is on a mobile device!)

It is this the logic to be applied, or there is another (and better) methodology?

Thank you and bye,
Francesco
 
Ido Green
author
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"...It is this the logic to be applied, or there is another (and better) methodology?..."
I would think you should use the same limitation (from the design of your site/app) because in the end of the day, you wish to use web workers for 'long-lasting' tasks that will run in the background.

 
Francesco Valle
Greenhorn
Posts: 9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you guys, I will try to pay more attention to performances in the future!

Cheers,
Francesco
 
Dave MacLean
author
Ranch Hand
Posts: 49
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe I'm too old-school, but I remember when browsers limited simultaneous connections to a server to 2. I would suspect that a browser running more than 2 web workers would still throttle on 2 connections (causing the third, fourth, etc to wait), so you'd have difficulty killing a server with lots of connections from lots of web workers. May make starting up lots of web workers kind of pointless if your goal is to download lots of content in simultaneous threads. I found this page that talks about the 2-connection limit:

http://www.openajax.org/runtime/wiki/The_Two_HTTP_Connection_Limit_Issue

- dave
 
Ido Green
author
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Dave - today most modern browsers got 6-40 connections: http://www.browserscope.org/?category=network so I guess we are in a better shape :)
Nevertheless, you are right about the idea that you should control the number of workers and their network usage.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic