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