DataBasic Reference > Programming in DataBasic > Efficiency Guidelines > Locking

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

RealityV15.1Online Documentation (MoTW) Revision 7

Locking (DataBasic) (m618705+eglocking.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

Locking

The purpose of a lock is to obtain exclusive access to a system resource on a multi-user system. When a process sets a lock, it holds up any other process requiring the lock until it is released by the first process.

Item Locks

Notes:

Transaction Handling

When using transaction handling and a transaction is in progress, the release of item locks set within a transaction is deferred until the transaction is completed or aborted. Therefore avoid the use of large transactions, particularly those started from TCL, since the holding of many locks can lead to a gradual system paralysis.

Execution Locks

Execution locks prevent multiple programs from executing all or a portion of DataBasic or Proc programs as defined by the same execution lock number. An execution lock does not, of itself, lock any file, group, item, or process.

Avoid the use of execution locks (LOCK and UNLOCK statements) to implement an item locking scheme. Improvements in the operation and use of read/update locks, and the introduction of item locks, alleviate most of the problems that warranted the use of execution locks in the past.

Read and Update Locks

Read and update locks (group locks) are used by the system when accessing items in files, therefore they are set and cleared by READ and WRITE and their variants. If many processes are accessing items in the same file group, collisions may occur. This may be alleviated by careful file sizing.

RealityV15.1 (MoTW) Revision 7Comment on this topic