tags:

views:

77

answers:

1

Is it possible to set priority to a thread that currently run some specific contract operation? Say I have WCF service with Func1, Func2 and Func3. I want that Func1 will have more priority over Func2 and Func3.

A: 

What exactly do you mean by "more priority"? Are you talking about preempting requests going to other operations? Are you using queues and want to force requests for one operation to be scheduled ahead of the others? Are you just talking about resource allocation (i.e. CPU) for threads running specific operations? Or what?

In general terms, however, it's very unlikely you can do this very easily. I'd argue that beyond the complexities involved (Windows has, overall, very poor support for controlling resource allocation), if the operations really have such specific needs, maybe they shouldn't be part of the same contract/service in the first place. Just something to think about.

tomasr
I talking about CPU resource. I have some data, that in most cases are read. But in some specific case it's updated. I want that the update will have priority.
Kamarey
There's really no *easy* way to do that.... that depends on a lot of factors, including what your backend is. Just at the WCF level, depending on how you host the service you could work something out (i.e self host both things in separate hosts and assign CPU priority, but it's tough even so).
tomasr