I need to create a large file (several gbytes) in /dev/shm. which is a RAMdisk on Linux machines. This must be as fast as possible. I'm currently using 5 separate POSIX threads in C to create sequential 100 mbyte segments, then I have another thread which concatenates them onto the main output file.
This is fast, but I want to go faster. Can I eliminate the concatenate thread? Is there any way to open a file, and have each thread write it's 100 mbyte segment to the correct place in the final output file?