Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site trwspp.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!sdcsvax!sdcrdcf!trwrb!trwspp!hasiuk From: hasiuk@trwspp.UUCP Newsgroups: net.unix-wizards Subject: Question on how to implement exclusive scheduling Message-ID: <620@trwspp.UUCP> Date: Fri, 12-Oct-84 22:10:23 EDT Article-I.D.: trwspp.620 Posted: Fri Oct 12 22:10:23 1984 Date-Received: Sun, 14-Oct-84 07:46:45 EDT Organization: T R W, Redondo Beach, CA Lines: 22 We are about to write an application which has multiple processes all updating a database stored on a raw disk partition. Realizing that this requires locking, we would like to implement something along the lines of a system call which prevents switching processes during critical sections of code. A glance at the sources would seem to point to making the changes in swtch(), perhaps such that it doesn't do anything while a flag is set other than return to the interrupted process. Another call would clear the flag and immediately allow another process to run, once the sensitive code decides that it has used the cpu enough and it is safe to switch to another process. Has anyone out there ever tried something like this before? Are there potential problems with resource monitoring preventing such exclusive use of the cpu? Is it possible to continue to make system calls while running in this state, and not relinquish the cpu to another process? What I would really like is a suggestion for an elegant way to accomplish this. By the way, we are running 4.2 on a Sun with source code support. Please mail responses directly to me. Thanks in advance. Lee Hasiuk {decvax,ucbvax}!trwrb!trwspp!hasiuk