Require socket and setup a unix socket pair.
Added two paths through the program, one for validation and one for counting. On first run the validation path will spawn a second process that runs through the counting path.
Setup validation_path and counting_path to talk to one another using unix sockets.
Moved methods into commented sections to more easilify differentiate the validation path from the counting path.
Couldn't find a way to pass half of a Socket pair to another process, so each process knows how to connection to the appropriate socket. This appears to only work for very small data sets before some sort of buffer error occurs.
Added some cleanup to deal with left over stuff from using unix sockets
Added ghetto rate-limiting to avoid the buffer issue when sending data through the socket, but it's still much slower than running a single process. Some serious rethinking is required.
Rolling back to code base before implementing sockets
Enable splitting of file using sed
Setup unix sockets so child process can communicate when it is done to the main process.
Setup initialize to detect if it's the main process or not, and if not to split the file and spawn the child process.
Add methods to combine the data from both processes into one data set.
Added cleanup method to close sockets and delete files created.
Child process will wait to exit until the parent process tells it to.
Had to add a short sleep to the child_sync method to avoid a strange buffer error on large data sets. Temporary hack while I learn more about IPC with sockets.
Change so script can still take input via STDIN. When input is via STDIN, the script will run as a single process.
Small change to detect if input coming through STDIN is from a file or not.
Minor naming changes to add clarity.