The application of multithreading in Javaweb

Source: Internet
Author: User

1.web application, in order to use a multi-threaded implementation of a task, the simplest code format must be executed to put the code in the Run method?


The Web server will help you to open up a thread for each access request, and you just follow the framework you've developed, such as tomcat, to let you write code using the servlet Framework. Really long story, don't write to run anyway, unless you want to control the thread to the extreme, for example you want to do the Test.


2. A Web site deployed on a server, when multiple browsers are accessing the same feature point, are there multiple threads to say?


Multiple browsers mean that if multiple pages (whether on multiple computers or on the same Computer) open a feature page of the same site, as the first question says, every access (that is, The Open Page) is a request, and the server opens up a thread for each request, which is Multithreaded.


3. What is the relationship between multithreading and concurrency?


Multithreaded execution efficiency is to judge the quality of concurrency, the concept of high concurrency is to ensure that the data is accurate, reduce the time required to operate the process, especially classic is the page access server, let the server to modify the database, if your database optimization done in place, Then the time to find the data and return to the client will be greatly reduced, we know that the amount of query for a popular site is very large, and then a server memory can receive a limited number of processes, so we say that a time period of processing threads (access Requests) The more, then the concurrency efficiency is better.

The application of multithreading in Javaweb

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.