D
dsitton
I've read several posts about his issue but could not understand what
exactly going on under the hood.
In a server scenario, a Thread Pool thread is processing a request. At
some point it needs to do an IO call (database, web service, file
system etc). Basically, I have two choices:
1. Synchronously. This will block the Thread Pool thread which is not a
good thing since this thread could be doing something else (process
other requests for example)
2. Asynchronously. The thread that currently executes the request will
return to the thread pool and another one will continue the work once
the callback is called. What I don't understand is, doesn't some
thread in the system needs to be waiting for a response anyway? Is this
going to be a thread outside the framework (which is just what I want)
or just another thread from the thread pool? Does this change from one
IO target to the other? How can I tell?
It is important for me to know since if it is just another thread from
the thread pool, I might be better off with option #1 since the code is
cleaner and it has the same affect.
Thanks,
Daniel
exactly going on under the hood.
In a server scenario, a Thread Pool thread is processing a request. At
some point it needs to do an IO call (database, web service, file
system etc). Basically, I have two choices:
1. Synchronously. This will block the Thread Pool thread which is not a
good thing since this thread could be doing something else (process
other requests for example)
2. Asynchronously. The thread that currently executes the request will
return to the thread pool and another one will continue the work once
the callback is called. What I don't understand is, doesn't some
thread in the system needs to be waiting for a response anyway? Is this
going to be a thread outside the framework (which is just what I want)
or just another thread from the thread pool? Does this change from one
IO target to the other? How can I tell?
It is important for me to know since if it is just another thread from
the thread pool, I might be better off with option #1 since the code is
cleaner and it has the same affect.
Thanks,
Daniel