#CPU Sharing question.
21-Aug-90 00:10:15
Sb: #117328-#CPU Sharing question.
Fm: Don Curtis/SYSOP 76703,4321
To: Christopher R. Hertel 76424,213
I'd set the daemon at a priority of +5 over the other database
program(s). My reasoning is that you want an updates, etc. to complete as
fast as possible. Otherwise you'll leave your self open for a slowdown and
a good possibility of losing data integrity.
Figure user A wants to update record 1234 and the message gets
passed to your daemon. User B wants to read record 1234. The daemon
starts to do the update, but it's time slice ends before it's done. Since
the reader program (user B) is running at the same priority…it starts
it's read operation on the partially updatted data.
Another way to handle that, whatever the priority, is to have the
daemon, as it's first task, lock the record via a flag. Then user B, when
attempting to read the record, would "see" that flag and wait until the
flag was cleared. But even doing it that way, you'd want the update
operation to complete as fast as possible so that user B didn't have to
wait too long.