3

ASynchronous WCF サービスで CCR を使用するこのソリューションについて

なぜこれを行う必要があるのですか:

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

callback(this) を呼び出すだけでなく、

QueueUserWorkItem はさらに別のスレッドを使用しませんか?

4

1 に答える 1

0

"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.

于 2009-03-22T02:49:03.610 に答える