| Version 1.9 Build 803
|
|
Next: Releasing AutoLocks in Glish Clients
Up: NOTE 256 - AIPS++ Table Locking
Previous: class TableLocker
AutoLocking working
AutoLocking is a handy mode because it frees the user from having to
do explicit locking and unlocking. Furthermore it has the advantage
that it does not release a lock before another process needs it.
This advantage is at the same time the weakness of
AutoLocking, because it may take a while before a process holding a
lock recognizes that another process needs a lock. For this to
understand it is explained how AutoLocking works.
- When table I/O is done, it is checked if the table is
appropriately locked. If not, it is tried to acquire a lock
with TableLock::maxWait as the maximum number of attempts
(default is trying forever).
- Unlocking is also done automatically. After some I/O-s are done,
the Table System inspects the list in the lock file to see if another
process needs the lock. If so, it releases the lock.
The inspection interval can be defined in the TableLock
constructor and defaults to 5 seconds.
In general this scheme works fine, but the problem is that if no I/O is
done, the Table System does not check if another process needs a lock.
This is especially a problem for glish clients as they can be idle for
some time waiting for a command to be given. To circumvent this problem
the function Table::relinquishAutoLocks can be used to
release locks on tables using AutoLocking. Either all such tables are
unlocked or only the tables needed by another process.
Subsections
Next: Releasing AutoLocks in Glish Clients
Up: NOTE 256 - AIPS++ Table Locking
Previous: class TableLocker
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc.,
Washington, D.C.
Return to AIPS++ Home Page
2004-08-28