question

DanielChoi-9925 avatar image
0 Votes"
DanielChoi-9925 asked DavidLowndes-6766 commented

_stat and _utime synchronization

Hi, I'm working on a project regarding time, and I 'm trying to read/write time data from different processes.

I'm thinking of using _stat/_utime to read/write time data, and I was wondering if anyone knew how _Stat and _utime manages synchronization.

_utime sets the modified Time and Access Time for a file, while _stat can get those data.

Could there be a race condition when using these two functions? or, could _stat read data while _utime is writing the data mid way and return corrupted Data?

I couldn't find a way for RWLock for windows between processes (SRWLock seems to be for threads only), and I'm wondering if using _stat and _utime is safe enough.

Thanks!

c++windows-api-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

While there may be a case where you read the values at the same time as they're being changed by another process, I would expect the operating system to ensure there was never any corruption.

0 Votes 0 ·

0 Answers