Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Multithreading limitation

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you guys, I will try to pay more attention to performances in the future!

Cheers,
Francesco
 
author
Posts: 51
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic