views:

336

answers:

2

Since Microsoft probably killed all download links to the Parallel Extensions CTP, I am totally lost.

I want to specify the max number of tasks running at a certain time, as I want more threads than processors. Any clue how to do this in RX?

+1  A: 

Are you able to specify the TaskFactory used in RX? If so, you can create one with a TaskScheduler with an appropriate concurrency level. It's not obvious to me at the moment whether there are "stock" schedulers which allow this, or whether it's hidden away (Parallel LINQ certainly offers "maximum concurrency" options) but that's the general plan.

Of course, if you can't change which task factory is being used, this doesn't help much.

Jon Skeet
How can I create a new TaskScheduler? Implement by inheriting the default `TaskScheduler`?
Jan Jongboom
Inherting default TaskScheduler sucks, as almost everything is private; and I don't feel for rewriting the whole scheduler part.
Jan Jongboom
@Jan: all you need to do is override the MaximumConcurrencyLevel property: http://msdn.microsoft.com/en-us/library/system.threading.tasks.taskscheduler.maximumconcurrencylevel(VS.100).aspx
Martinho Fernandes
You cannot in .Net 3.5, you are forced to override lots of queue'ing stuff that you cannot redirect to the base class, as it's hidden from the inherited class.
Jan Jongboom
A well I've just gone with the default ThreadPool :-)
Jan Jongboom
A: 

Haven't found any solution. Used the default ThreadPool instead.

Jan Jongboom