tags:

views:

255

answers:

1

Regardind this solution http://stackoverflow.com/questions/494463/using-the-ccr-with-asynchronous-wcf-service

Why do you need to do this :

ThreadPool.QueueUserWorkItem(s => callback(this));

instead of just calling callback(this) ?

Isn't QueueUserWorkItem going to use yet another thread ?

A: 

"callback" is a method that needs to be provided as an input parameter to BeginGetAccount. In the answer it doesn't specify the "callback" method so there is no way to know if it makes use of a new thread or not and therefore it does make sense to put the "callback" method on a seperate thread in Complete.

If you could guarantee "callback" created its own thread then you wouldn't need to create one in the Complete method.

sipwiz