pipes and atomic writes

Dave Martindale dmmartindale at watrose.UUCP
Sun Dec 18 19:45:08 AEST 1983


	From: mason at utcsrgv.UUCP (Dave Mason)

	According to pipe(2) 'writes with count <4097 are atomic..'...
	What happens if they cross a page boundary and the new page is
	not currently resident on 4.2?  Will it still be atomic?  Seems
	difficult to me unless they specifically check & force pages
	resident before starting the copy.

No, all that is necessary is that the inode of the pipe remain locked
during the entire copying process, including any page faults that occur.
If this is done, any other process which also wants to write to the pipe
will simply sleep until it can manage to lock the inode for itself.



More information about the Comp.unix.wizards mailing list