FileHelpers icon indicating copy to clipboard operation
FileHelpers copied to clipboard

Add parallel support (TPL and async)

Open MarcosMeli opened this issue 10 years ago • 5 comments

Let discuss what is the best approach to make the library Task friendly and Thread Safe for concurrent work

MarcosMeli avatar Jun 29 '15 01:06 MarcosMeli

Can I Jump in into this?

ghost avatar Jun 30 '16 10:06 ghost

Hi @hanu412 of course you can join in, welcome to the team

What idea did you have, maybe return Task<List<TRecord>> in some methods ? Thanks

MarcosMeli avatar Jun 30 '16 11:06 MarcosMeli

I kind of built a similar framework where we had to process ~20million records every night in a fixed length files. It purely works on TPL. You're absolutely spot on in saying return a Task. One more thing is we implemented chunking-where we don't load the whole of the file into memory but small chunks using MemoryMapped IO from .Net. We can talk/discuss more on it.

ghost avatar Jun 30 '16 13:06 ghost

Great @hanu412 at work we have a TPL Dataflow that uses a FileHelperAsyncEngine as producer and make some transformations and bulkcopy it into the SqlServer

You are using the Microsoft TPL DataFlow package or just the Task Framework of .net ?

MarcosMeli avatar Jun 30 '16 13:06 MarcosMeli

It is the simple Task (Task Parallel Library), we have been using for our work. It is NOT the data flow package.

ghost avatar Jun 30 '16 14:06 ghost