Complexity of fseek operation

22 Views Asked by At

I have a usecase where 1 thread would be reading the file and other thread would be appending to the same file. So thinking of using same file descriptor to serve both reads and writes by doing fseek operation as required.

What is the complexity of fseek. Is it o(1) or O(n) where n is the position we want to seek to.

Other option would be to use different fileHandles for read & write, since multiple threads are going to do this in parallel, fileHandle limit (1000) on linux would become a problem

0

There are 0 best solutions below