On Aug 5, 12:19 am, Spam Catcher <spamhoney...@rogers.comwrote:
Morgan Cheng <morgan.chen...@gmail.comwrote innews:11*********************@i38g2000prf.googleg roups.com:
Since ASP.NET 2.0, asynchronous web service client can be implemented
with event-based pattern, instead of original BeginXXX/EndXXX pattern.
However, I didn't find any material about event-based server side
asynchronous web service. So, we can only implement asynchronous
webmethod with BeginXXX/EndXXX pattern, right?
I don't why ASP.NET 2.0 don't provide event-based server side pattern.
Do you mean allowing the server to push information to the client?
You can't because web services are 1 way.
No, i don't mean allow the server to callback client, but let
asynchronous operation in server side.
That is, IIS arrange one thread to initialize operation of incoming
request, but the thread has no need to escort the whole processing of
the request. Because WebService may involves I/O operation,
synchronous web method will make the thread block on I/O. This is not
good, since by default there is 25 worker threads per CPU.
>
Or do you mean asynchronous processing on the server side? You don't really
need to because IIS will process each request in it's own thread context.
You only need to spawn additional thread if you have multiple tasks to
complete.
Though worker thread number in TheadPool can be configured, it is not
suggested.
Better way is to make I/O operation performed in I/O thread in
asynchronous way.