Answer the question
In order to leave comments, you need to log in
How to handle multiple requests at the same time?
I'm learning a little C#. There is a code:
public async Task<int> Get()
{
await Task.Delay(5000);
return Thread.CurrentThread.ManagedThreadId;
}
Answer the question
In order to leave comments, you need to log in
If I understand correctly, this is a controller in asp net.
If you are using asp net core then they should run in parallel.
Perhaps you have some kind of synchronization in the calling code that does not allow you to run two queries at once.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question