Simon Slavin wrote: > On 14 Aug 2018, at 3:09pm, Clemens Ladisch <clem...@ladisch.de> wrote: >> However, there are other file >> operations that are properly synchronized, e.g., it is not possible for two >> NFS clients to create a directory with the same name. > > You are correct. But there's still a problem with simulating a mutex system. > > Suppose two computers try to create a remove folder with the same name at the > same time. The request which is processed first gets "completed > successfully". > If everything is done correctly, the second request would get "folder with > that > name already exists". But since the job has been done (a folder with that > name > does exist, so the task must have been completed, so the programmer should be > happy) the second request is quite likely to get "completed successfully" too.
In practice, NFS implementations do report this error correctly. > It takes a very fussy filesystem programmer to make their code report "the > thing you asked for is complete as you requested, but I didn't do it". EEXIST is just one of many error codes that is simply passed through from the real file system. An NFS server would have to go out of its way to change this error into something else. And while trying to be 'clever' with locking could give performance gains, no such benefit exists for mangling the mkdir() result. Regards, Clemens _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users