I’m looking at using FileHelpers in a file reading/writing library. This library will be highly parallel and concurrent using async-await as well as Tasks.
As I understand it, FileHelperAsyncEngine is asynchronous internally, but there’s no *Async methods for async-await, so each file will tie up the calling thread until the file is loaded.
While it’s obviously possible to e.g. Task.Run(…FileHelperAsyncEngine …)
, I will likely run into a thread creation performance bottleneck when trying to read thousands of small files (as parallel as possible) this way since the threadpool only spins up extra threads (i.e. more than #cores) once every 0.5 seconds, which has quite an overhead and is (in my context) too slow.
Ideally I would be able to e.g.
await ReadNextsAsync()
, or at least use the APM pattern: https://msdn.microsoft.com/en-us/library/dd997423%28v=vs.110%29.aspx
Are there any plans to add async-await support to FileHelpers?
Do you see any good way to use the APM pattern with FileHelpers?
Thanks! Kristian