文档介绍:CHAPTER9Application Design andDevelopmentPractice is the main reason why servlets give better performancethan pro-grams that use mon gateway interface (CGI), even though Javaprograms generally run slower than C or C++ programs?Answer:TheCGIinterface starts a new process to service each request,which has a signi?cant operating system overhead. On the other hand,servelets are run as threads of an existing process, avoiding this , the process running threads could be the Web serverprocess it-self, avoiding munication which can be expensive. Thus,for small to moderate sized tasks, the overhead of Java is less than theoverheads saved by avoiding process creating tasks involvinga lot of CPUactivity, this may not be the case, andusingCGI with a C or C++ programmay give better some bene?ts and drawbacks of connectionless protocols over proto-cols that maintain :puters have limits on the number of simultaneousconnections they can accept. With connectionless protocols, connectionsare broken as soon as the request is satis?ed, and therefore other clientscan open connections. Thus more clients can be served at the same request can be routed to any one of a number of different servers tobalance load, and if a server crashes another can take over without theclient noticing any drawback of