Consider the following code.
using System.Threading.Tasks;
using System.Collections.Generic;
using HiQPdf;
namespace bla
{
class Program
{
private static List<Task> tlist = new List<Task>();
static void Main(string[] args)
{
for (int i = 0; i < 21; i++)
{
tlist.Add(Task.Run(() =>
{
var r = new HtmlToPdf();
var pdf = r.ConvertUrlToMemory("google.com");
}));
}
Task.WaitAll(tlist.ToArray());
}
}
}
This creates 20 instances of HiQPDF which creates an image of google. Thing is, HiQPDF creates an instance of HiQPDF.dep and HiQPDF.rda, which do the actual work. The maximum number of parallel HiQPDF processes seems to be 4. This is quite a long process and is critical for what I want to do.
What I want is increasing the limit of 4 concurrent processes.
I tried using Parallel.ForEach()
and .AsParallel().ForAll()
, different implementations of Threading
but nothing helps with increasing the actual number of processes that run in parallel. I'm starting to think this is a limitation of Windows 10.