Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: FSWrite moving memory? (was Re: Think C 4.0 questions) Summary: Yes it will. Message-ID: <34240@ucbvax.BERKELEY.EDU> Date: 11 Feb 90 23:43:21 GMT References: <10682@bsu-cs.bsu.edu> <1968@cbnewsk.ATT.COM> <10111@hoptoad.uucp> <90039.151841CXT105@PSUVM.BITNET> <1510@smurf.ira.uka.de> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Organization: School of Education, UC-Berkeley Lines: 36 In article <1510@smurf.ira.uka.de> urlichs@smurf.ira.uka.de writes: >In comp.sys.mac.programmer, article <90039.151841CXT105@PSUVM.BITNET>, >CXT105@psuvm.psu.edu (Christopher Tate) writes: >< In article <10111@hoptoad.uucp>, tim@hoptoad.uucp (Tim Maroney) says: >< >< >Why do you say FSWrite can move memory? It's not in the lists, so unless >< >it's in an unlocked segment, I don't see how (or why!) it would move memory. >< >< >Not in this case. All file system calls are supposed to be callable from >interrupt, and so they (as well as any patch sitting on them)_can't_ move >memory. Wrong! Wrong! Wrong! The file system calls can not be called from interrupt level. Neither the SCSI manager, nor the file manager does the semaphoring to properly lock important data structures so that your disk will not be scrambled by interrupt level access. In addition, the mac uses a B-Tree catalog to manage file extents. Where do you thing it is going to put that B-Tree? As the file gets large, the structures that describe where that file is on disk _must_ grow. This will move memory. (I wouldn't be so emphatic about it, but it might be _my_ hard disk that crashes as a result of running a program that has this error in it.) >Unfortunately, I wonder if they still could possibly move memory in the >synchronous case, which may not be called from interrupt. >If the disk to be written to isn't online, the Mac will display its nice >"Please insert the disk" alert. It would be interesting to know if this can >make any memory manager calls, and if so, in what heap. Since these are just resources, they certainly will move memeory unless they've already been read in and locked in. There is a system call: CanAlert(), to preread such things. Does your program call it? --- David Phillip Oster -- No, I come from Boston. I just work Arpa: oster@dewey.soe.berkeley.edu -- in cyberspace. Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu