At least for modern editors, but I think also some of the CP/M "word processor" ones, actually do not "edit in-place". They create a new file to contain the results of the edit, then delete the old and rename when finished - possibly keeping the old as a backup. In order to "share" a file being edited, more work must be done. Even on modern systems (Linux), sharing of files being edited doesn't really work well.
Right! I'd left the discrete operations unmentioned, my bad.
For even lowly PMate, the minimum atomic operations for editing and saving a file are:
1) open input FILE.EXT. Even though PMate does not modify this file directly (until step 4, SAVE) MP/M considers it open and essentially locked/owned by the process PMate.
2) delete, then create the temporary working output file FILE.$$$
3) (data read from input, edit, write to output; user operations; various complexity seeking back and forth within input and output files).
4) A "SAVE" command generally: a) outputs in-memory changes to output file, copies remainder of input file to output file, as necessary. b) input and output files are closed. c) input file renamed to FILE.BAK, or deleted if no backup made. e) output file renamed to FILE.EXT.
So after a "save" the original input file, from the user's point of view, is exists with desired changes. In fact a new file with edited contents of the same name has been created, then optionally re-opened by the editor (in my usage case example). It is at THIS point that the compiler might want to open the file, additionally, as read-only. With the assumption being that editing will not change the file until the compiler is done with the file.
The edit/compile/test lather-rinse-repeat cycle requires some care from the user! Unsurprisingly, especially on antique 8-bit multiprocessing systems. The fact this can be done AT ALL is a testament to DRI's fantastic work! Someone not me somewhere wrote that MP/M may be the most sophisticated piece of software ever written for the 8080; its hard to argue with that!
There's plenty of opportunity for hanky panky in here; the editor making changes to the file WHILE the compiler has it open for reading is at minimum a Really Bad Idea. Late *nix OSs probably do about as good a job as is possible with silliness like this (and there's pipes and other complex things well out of our scope here).