How to set WCF threads to schedual differently

Posted by Gilad on Stack Overflow See other posts from Stack Overflow or by Gilad
Published on 2010-05-11T13:31:19Z Indexed on 2010/05/11 13:34 UTC
Read the original article Hit count: 419

Hi,

I'm running a winservice that has 2 main objectives.

  1. Execute/Handle exposed webmethods.
  2. Run Inner processes that consume allot of CPU.

The problem is that when I execute many inner processes |(as tasks) that are queued to the threadpool or taskpool, the execution of the webmethods takes much more time as WCF also queues its executions to the same threadpool. This even happens when setting the inner processes task priority to lowest and setting the webmethods thread priority to heights.

I hoped that Framework 4.0 would improve this, and they have, but still it takes quite allot of time for the system to handle the WCF queued tasks if the CPU is handling other inner tasks.

  1. Is it possible to change the Threadpool that WCF uses to a different one?
  2. Is it possible to manually change the task queue (global task queue, local task queue).
  3. Is it possible to manually handle 2 task queues that behave differently ?

Any help in the subject would be appropriated.

Gilad.

© Stack Overflow or respective owner

Related posts about c#

Related posts about multithreading