Question on how to implement exclusive scheduling

hasiuk at trwspp.UUCP hasiuk at trwspp.UUCP
Sat Oct 13 12:10:23 AEST 1984


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



More information about the Comp.unix.wizards mailing list