Reply to post: Re: Restarts

Microsoft releases command-line package manager for Windows (there are snags)

Dazed and Confused

Re: Restarts

@Brewster's Angle Grinder, you're right this is an accurate description.

It can vary from implementation to implementation. Some of it is beneath the vnode layer in the Unix kernel and so could potentially vary between different filesystems. Not all implantations even managed to be coherent between nmap MAP_SHARED and the traditional read/write system call interface to files.

To get a guaranteed consistent view of a file with MAP_PRIVATE you need to open the file, lock the whole thing, or at least the part you're interested in, then touch all the pages so your processes address space sets up all the data structures down to the page level and then unlock it. But that's really no difference to the behaviour of the read/write interface. If you open a file and start to read it while someone else is writing to the file you can get some old and some new new data. It is only the individual systems calls which are guaranteed to be atomic.

Things like libraries are normally only open read only so you don't need to worry about this sort of issue.

Also, not all systems allow you to unlink an open executable and you can get a text busy error, however you can rename an open executable so that an updated version can be inserted in its place.

NFS used to add "interesting" layers of behaviour too as it was never fully SVID compliant.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon