A multi-threaded application server
?? Saral Saxena ??????
?11K+ Followers | Linkedin Top Voice || Associate Director || 15+ Years in Java, Microservices, Kafka, Spring Boot, Cloud Technologies (AWS, GCP) | Agile , K8s ,DevOps & CI/CD Expert
Above figure shows three concurrent requests to a program that has five threads. All three requests wait that the execution is very near.
lets say if we want to execute the same block of code called myPopularProc(). As the figure shows, each one of these threads can execute this code at the same time (since the CPU runs one thread at a time, this is not quite true, but it's very close depending on the function). In fact, each thread is currently executing a different line of code, as the figure shows. Thus, threads do not have toin line to execute the same piece of code. They can be interleaved so that the execution is nearly parallel.