romy@uiucuxc.Uiuc.ARPA (07/19/85)
Here's a question for all you real technical types out there on the net. The problem deals with computer networking of PCs and using one of them as a disk server. This is posted for a friend of mine, so direct all mail to me and I will forward it to him. Please send mail, as opposed to posting on the net. If (though I doubt it) there is a large enough interest, I will post a summary. Thanks in advance. Neil Romy UUCP: {ihnp4,pur-ee,convex}!uiucdcs!uiucuxc!romy ARPA: romy%uiucuxc%uiuc.arpa CSNET: romy%uiucuxc@uiuc.csnet US Mail: University of Illinois, 51 Gerty Drive, Champaign, IL, 61820 AT&T: (217) 333-4585 ---------------------- THE SYSTEM: A PC-XT with a 10 M-byte Winchester disk acts as a disk server for several remote PCs, all connected via an Ethernet cable. Each remote PC has a device driver that issues a Remote Procedure Call (RPC) for ROM/BIOS interrupt 13h which is received by and interrupt service routine at the disk server and executed there. The ROM/BIOS interrupt 13h will read or write sectors to the Winchester disk. The disk server interrupt routine, upon receiving the interrupt 13h parameters, will read or write to the Winchester disk, and return any necessary information to the remote PC (e.g. status of interrupt 13h call, sectors corresponding to a READ request, etc.). THE PROBLEM: The problem here is the famous (or infamous) reader's and writer's problem: how do you stop two users from writing to the same sectors of the Winchester without knowing about the other. The solution to this problem defies traditional contention resolution schemes. It involves denying access to any other user once a write transaction has been started. This can be done automatically by the server interrupt handler once it detects that a particular PC is writing to the disk. However, when do you allow other user's to write to the disk? How do you know when the DOS at a remote PC is done writing to the disk? WHAT I'M LOOKING FOR: One solution to this problem, although perhaps not the best one, would be having a server PC know when the write transaction is over. It cannot know this (so far as I know) because, when DOS calls a driver, it simply tells it which sector to read or write, and how many. A write transaction, for example, could consist of many write calls to a driver. The driver does not know how many of these calls DOS will make, and thus cannot know when DOS is done writing. If it could know that it was doing the last write transaction, it could send the server a special frame that would instruct the interrupt handler there to accept write requests from other stations. Currently, I have implemented automatic locking at the server with manual unlocking at remote clients. In other words, when a client (or the local server user) makes a write operation to the Winchester disk at the server, write requests from anyone else are automatically blocked until the user that is writing manually unlocks the disk. It would be desirable to also automate the unlocking process. Does anyone out there know if there is some undocumented feature in PC-DOS V2.x or V3.0 or some program (no, I don't want to try to decode SHARE.EXE in DOS V3.0) that would tell an application if DOS was done writing? Does DOS generate some sort of interrupt, or does it set a memory byte somewhere that would indicate this? Alternatively, can anyone else propose another scheme other than perhaps partitioning the disk and allocating a chunk of it to each user? (We have already considered it and find it inadequate for our needs).