Peformance: Processes v's Threads

  • Thread starter Thread starter Tim Smith
  • Start date Start date
T

Tim Smith

Hi,

I have a Service which is a single executable and 10-12 remoting
threads. Each thread executes database SQL, writes to files on behalf
of clients.

Will a thread ever block the entire process when waiting for a
file/database?

Assuming a server which 2-4 CPUs are there any performance penalties
for having one process with 10 threads versus 5 processes with 2
threads?

thanks!

Tim
 
Tim said:
Hi,

I have a Service which is a single executable and 10-12 remoting
threads. Each thread executes database SQL, writes to files on behalf
of clients.

Will a thread ever block the entire process when waiting for a
file/database?

No. But real disk access may block the whole system, depending on the
driver. If you have 1MB RAM and try to write 100MB per second to
hard-disk, the computer would definitely hang.
Assuming a server which 2-4 CPUs are there any performance penalties
for having one process with 10 threads versus 5 processes with 2
threads?

It usually takes more time to switch threads in different processes
because their data is not shared. Besides, since .NET's AppDomain can
provide isolation within a single process, you have no reason to use
multiple-processes at all (though AppDomain is not as solid as process
because of unmanaged code)
 
Back
Top