I have multiple REST API calls which I want to do in parallel way. E.g.
I have a REST API call CreateData(). I want to create 1000 datas in server which is adapted for multi-thread operation in 4-5 parallel threads.
I am C++ developer and know how multithreading works in C++. I am quite naive in C# coding. I know about async tasks but dont have idea how to acheive the above said task.
var response = await Task.Run(()=>CreateData());
Right now I am doing it in sequence where one by one I am creating the data in a single thread once I have recieved response of previous CreateData(). It is impacting the perfomance badly and taking hell lot of time.
I want to create say 5 threads which will do the REST API calls in parallel manner for all the 1000 users.