Linked Questions

0 votes
1 answer
366 views

I have a simple taken form MS documentation implementation of generic throttle function. public async Task RunTasks(List<Task> actions, int maxThreads) { var queue = new ...
user2555515's user avatar
  • 1,089
0 votes
1 answer
710 views

I found out that if construct a new task using the following way: var task = new Task(async action); task.Start();, the any call of any async method (await Task.Delay(), await new WebClient()....
Googman's user avatar
  • 141
0 votes
2 answers
400 views

I have below code, which should wait 10seconds. Problem is that it completes immediately, the WhenAll method is not working - what am I doing wrong here? public class WhenAllIsNotWorking { public ...
ojek's user avatar
  • 10.1k
0 votes
0 answers
58 views

I want create a task, which itself calls a async method. var task = new Task(async () => { var res = await asyncMethod(); Console.WriteLine("Async"); }); task.Start(); Task....
J. Doe's user avatar
  • 530
60 votes
3 answers
45k views

I have this construct in my main(), which creates var tasks = new List<Task>(); var t = Task.Factory.StartNew( async () => { Foo.Fim(); await Foo.DoBar(); }); /...
Nathan's user avatar
  • 6,561
5 votes
3 answers
5k views

I using ASP.NET Core Identity, with Jmeter app I send multiple requests to my web application for create user and it created multiple users with same email, although my RequireUniqueEmail is true ...
Milad Ahmadi's user avatar
3 votes
2 answers
7k views

I want to start a collection of Task objects at the same time and wait until all are complete. The following code shows my desired behaviour. public class Program { class TaskTest { ...
ChristianMurschall's user avatar
5 votes
2 answers
2k views

I've got a caching class that uses cold (unstarted) tasks to avoid running the expensive thing multiple times. public class AsyncConcurrentDictionary<TKey, TValue> : System.Collections....
Fowl's user avatar
  • 5,136
1 vote
1 answer
903 views

I used following code to execute the SourceCreator method without blocking UI. string a =null; private string SourceCreator() { string sum = textBox7.Text; sum = sum.Replace(" ", &...
herry jack's user avatar
3 votes
1 answer
93 views

I created a task like the following code Task task = new(async () => { // without await Task Delay dont work await Task.Delay(TimeSpan.FromSeconds(5)); Console.WriteLine("Task is ...
mohamad hosein ghelich khani's user avatar
-1 votes
2 answers
118 views

I have this metod: public async Task StartAsync(Task process) { if (process is null) { throw new ArgumentNullException(nameof(process)); } var loading = ...; await Task....
Gabriel Anton's user avatar