Hello. 

I am writing a little soap server where requests would create for
example 10 threads. Would it be "better" to just create 10 threads and
then wait for connections and give jobs to threads until "thread pool
is full" or to create thread and then terminate it every time request
comes?

I am following http://www.cs.fsu.edu/~engelen/soapdoc2.html#tth_sEc7.2.4

7.2.4  How to Create a Multi-Threaded Stand-Alone Service

where author says:
"The advantage of the code shown above is that the machine cannot be
overloaded with requests, since the number of active services is
limited. However, threads are still started and terminated. This
overhead can be eliminated using a queue of requests (open sockets) as
is shown in the code below."

Why creating and then terminating threads is overhead?

Thank you for answers.

Kind regads,

Rok




Reply via email to