12-02-2016 06:13 AM
Hello,
I'm designing an application in which there are two threads. The first thread would create a TDMS file and will keep on writing data acquired from multiple sensors to the file until the program exits. I'am keeping the file handle as a global variable acessible to any thread.
The second thread should use the same file handle(static global variable) and has to continously read data from the file in chunks and do some processing.
Will there be any problem with file acess if i go ahead with this method?.
Note: I cannot keep the data written to file on PC RAM for processing as the size of data is in GB's.
12-04-2016 11:05 AM
It is probably not a good idea. The pointer to the file location will move around between read write operations and overwrite chunks of data and you will probably have to spend time developing features similar to database like functionality to achieve your goals.
I would use a database that is designed for this type of functions, like SQL express or MySQ and have multiple threads access the data in a controlled fashion without redesigning the wheel.
12-04-2016 11:43 PM
Ditto. If not a fifo frame buffer, than SQLITE can do the job.