*snip*
Files so far range from 500MB to 3GB or more. Future could be 10GB files
Windows, Linux, Mac would be cool to target as well.
I am using threads so that it will hopefully be faster, I want my user to continue using my GUI while the parsing is happening in the background.
Not sure what you mean by relations within CSV files.... i really just need to pull one line at a time from the source CSV and write one of its columns to a new text file.
Immutable during processing? Well, they wont be read or written to by any other programs... they are static.
And if you still wish to involve multi-threading into this, you must be aware that MT adds an
additional level of complexity.
In general you should be able to:
- Create a thread
- Transfer the arguments to it. The usual procedural parameters doesn't work since each thread has its own separate stack
- Start the thread
- Transfer some feedback to the main thread. Again, the procedural parameters won't work, you should use some object fields/properties for that, and you must synchronize with the main LCL thread. Otherwise, bad things can happen
- Detect when the thread has finished its work
- Additionally, you may wish to be able to prematurely terminate the thread
I have prepared a small sample how to do it, this time it is a workable one. I hope it is clear enough. See the attachment.
I don't believe threads will make your processing faster, in fact, supplying a feedback to GUI and synchronization will introduce additional delays. Also, you must provide some means of "locking" the related GUI elements until the working thread finishes at least for UI consistency. The only benefit I see is the more responsible UI.
BTW, from your posts I understand that your program is 64-bit. If that is the case I can't see what are your concerns in regards of available RAM.
Regards,