suppose sample snippet:
public async void writeDataOnFile (byte[] data, string filePath) {
using(var fs = new FileStream(filePath)) {
await File.WriteAsync(data,0,data.length);
}
}
I know that no background thread is consumed from thread pool,but an IO operation will be started and thread will be notified at the end.
Question is: HOW does async/await understand that WriteAsync is an IO-bound method rather than a CPU-bound method?
Any help would be appreciated.