Multithreading in regards to WCF Service and a Web Service

I read the following article indicating the following:
WCF Services can be multi-threaded via Service Behavior class, while web services cannot be multi-threaded.

See article:
http://www.differencebetween.com/difference-between-wcf-and-vs-web-service/

My question is how does a Web Service handle multiple request if it isn't multi-threaded?
Does the request invoke new instances of the web service?
Lawrence AverySystem DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

b_levittCommented:
I would say the referenced article is incorrect.  As you correctly identified, IIS is certainly "multithreaded" as is a WCF service and there is nothing stopping you from using additional threads in the middle of a call.  I think the article botched the concept of additional concurrency control options that WCF has within a client session via the ConcurrencyMode behavior.

I think this article has the best example:
http://blogs.msdn.com/b/rickrain/archive/2009/06/17/wcf-instancing-concurrency-and-throttling-part-2.aspx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Lawrence AverySystem DeveloperAuthor Commented:
Ok so because the Web Service is hosted by IIS, it can handle multiple request, correct? And the WCF Service can create instances upon a request?

So in essence they both can able to handle Multi-Request without adding coding (Except in the WCF Service modifying the ConcurrencyMode behavior to Multiple?

Here is a very good article on WCF Service on handling request:

http://www.codeproject.com/Articles/86007/3-ways-to-do-WCF-instance-management-Per-call-Per
0
b_levittCommented:
Even with the WCF service with ConcurrencyMode=Single, it is still threaded in the same sense that an ASMX service is - requests made by separate clients would be executed on their own worker thread.
0
Lawrence AverySystem DeveloperAuthor Commented:
From reading the article above, it would seem that the data manipulated in the
( ConcurrencyMode=Single- which means one instance of the WCF Service)
WCF  Service is shared by all the clients calling it. In other words multiple threads access the same WCF Service instance.  There must a Lock on the instance when WCF Service is in Single mode.


Do you have an article on how ASMX handles multiple concurrent request? I know ASMX is hosted by the IIS. You are saying it's multi-threaded. In this case do you really mean that the ASMX is instantiated  by every request to it and  that each instance has its own thread?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.