Parallel process interest in C# In web api controller:
I am a newer in parallel and Async&amp;Task programming. Need someone help me code review. 

public async Task&lt;IHttpActionResult&gt; DoWork()
{
    List&lt;string&gt; listTask = await Helper.GetBlockBlock();
    userIds = listTask;
    this.ParallelTaskWork();//step 1,must be finished,but I an not sure when..
    await this.Service.GetAllClientInterestInfoList();//executing after step 1 
    return this.Ok();
}
public async void ParallelTaskWork()
{
    Task[] taskList = this.TaskMaker(totalNum);
}
public Task[] TaskMaker(int threadNum)
{
    Task[] taskList = new Task[threadNum];
    Parallel.For(0, taskList.Length, i =&gt; taskList[i] = new Task(this.ProcessDealTask));
    Parallel.ForEach(taskList, t =&gt; t.Start());
    return taskList;
}
private void ProcessDealTask()
{
    for (int i = 0; i &lt; totalNum; i++)
    {
        List&lt;string&gt; users = this.GetPartitionOfList(userIds, i, totalNum);
        Task task = this.ParallelDealUserList(users);
        task.Wait();
    }
}
private List&lt;T&gt; GetPartitionOfList&lt;T&gt;(List&lt;T&gt; userList, int index, int total)
{
    int section = (userList.Count / total) + 1;
    int end = (index + 1) * section &gt; userList.Count ? userList.Count - index * section : section;
    if (end &lt; 0) end = 0;
        int start = index * section &lt; userList.Count ? index * section : userList.Count - 1;
    if (start &lt; 0) start = 0;
        return userList.GetRange(start, end);
}
private async Task ParallelDealUserList(IEnumerable&lt;string&gt; list)
{
    await Task.Run(() =&gt; Parallel.ForEach(list, async (id, loopState) =&gt;
    {
        try
        {
            await GrainClient.GrainFactory.GetGrain&lt;IUser&gt;(id.ToGuid()).DoProcessInterestAsync(true);
        }
        catch (Exception e)
        {
        }
    }));
}


Any performance problem? The method ParallelDealUserList I refer to https://stackoverflow.com/questions/19102966/parallel-foreach-vs-task-run-and-task-whenall
somebody said  


  there is a disadvantage to use Task.Run in a loop- With
  Parallel.ForEach, there is a Partitioner which gets created to avoid
  making more tasks than necessary


and  The method TaskMaker
https://stackoverflow.com/questions/22988630/parallel-for-w-action-that-creates-different-tasks-c-sharp
First thing is that you should limit the degree of parallelism, to ex: 4 threads

Parallel.ForEach(
    listOfWebpages,
    new ParallelOptions { MaxDegreeOfParallelism = 4 },
    webpage =&gt; { Download(webpage); }
);


Without this, you are going to DDoS your service or resource you are using.



You seem to be using Project Orleans and AFAIK a grain should be a single threaded container. You should be able to do just:

private void ParallelDealUserList(IEnumerable&lt;string&gt; list)
{
    foreach(var item in list)
        GrainClient
            .GrainFactory
            .GetGrain&lt;IUser&gt;(item.id.ToGuid())
            .DoProcessInterestAsync(true);
}




I am not all that familiar with Project Orleans. Most likely this can be used, but I would use microservices (aka SOA2) instead.