Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!unido!ira.uka.de!smurf!urlichs From: urlichs@smurf.ira.uka.de (Matthias Urlichs) Newsgroups: comp.sys.mac.programmer Subject: Re: File System Re-entrancy Message-ID: <1258@smurf.ira.uka.de> Date: 29 Nov 89 22:17:54 GMT References: <924@maytag.waterloo.edu> Reply-To: urlichs@smurf.ira.uka.de (Matthias Urlichs) Organization: Uiversity of Karlsruhe, FRG Lines: 46 In comp.sys.mac.programmer jb@aries5.UUCP, writes: < This may seem like a strange question but seeing the discussion on < multi-tasking, I have a related question. < < Is there any reliable way to make the device manager re-entrant. < That should be the file manager..? < In other words if I do a PBRead() to a device driver can that device < driver synchronously do another PBRead() to another device driver? < One simple answer: No. Not even asyncronously. I assume that you want to do something like what I tried to do a few years back: the straight-ahead way to partition a disk would of course be to open a file and then write a "disk driver" which simply does PB{read,write}() calls on that file. No such luck. Apart from the obvious (the file manager queue), the file manager implements its own internal stack for async requests, plus state variables and (since HFS) two special files which make this even more complex. My hack of a solution was to allocate the file contiguously (using AllocContig) and then, after opening the file, calculate its beginning on disk from the information from GetVolInfo() and from the FCB (_not_ generally recommended). You will have to test that the file is still contiguous (if somebody copies it, it is likely not to be anymore); this is easy because the FCB contains the first three extents: the last two should be zero. You will also run into the fact that doing this right (ie. if your driver is called asynchronously; it may well be) is not easy. This "solution" (apart from being a hack anyway) only works on local disks which indicates that there should be a better solution. < < Jim Bruyn I suggest that you post a note describing exactly what you want to do; then we'll all come up with some better ideas. ;-) NB: Some rather vague Sytem 7.0 information (reliability level and source attribution: grapevine) says that the paging file for virtual memory will not have to be contiguous. I wonder if Apple will do this right (ie. make the emergency file manager call available for those who need it), or not (ie. hack it in, using heaps of undocumented file manager features). Based on past experience I tend to expect the latter. :-( -- Matthias Urlichs