CPU Sharing question.
23-Aug-90 00:14:15
Sb: #117510-CPU Sharing question.
Fm: Don Curtis/SYSOP 76703,4321
To: Christopher R. Hertel 76424,213
Chris,
One of two mechanisms…
semaphores or messages. Have a master process, the 'brain' if you
will. This would be the traffic cop of the system, all database access
must ask permission of the master program (via a message or semaphore) and
wait for a reply to continue before it goes on. When it's done, it tells
the master program it's done.
Thus, the master can allow multiple searches to run at once, or a
single add plus a search….but won't allow and updates, resturctures or
deletes to occur until all searches are finished (or anything else that
would conflict).
When a program has made a request for an action, and until it
receives permission to proceed…it simply waits for the master to tell it
to proceed. WaitPort() would be appropriate for this if you were using
messages. The process calling WaitPort() will sleep until a message is
received.
The master can be a very simple program. It only needs a local
stack where it stores what operation(s) are in progress and a 2nd stack of
what requests have been made. And then of course, it needs the IPC
facilities.
Don