Consistency Control

< Previous | Contents | Manuals Home | Boris FX | Next >

Consistency Control

The listener operates asynchronously on one or more threads, one per connection, independent of the main SynthEyes thread. If the listener tries to make changes at the same time as the user (or other listeners), chaos will ensue! That must be avoided. The listener provides tools to help, but they must be systematically used by the client software, and even still, simultaneous monkey-clicking and listener operations may be able to find ways to cause crashes. Normally, the user should be quiescent when the client/listener connection is active.

The Lock()operation locks out the user and any other listener connections, so that they cannot interfere. The corresponding Unlock() releases the lock so that other operations can occur.

Lock and Unlock can be nested.

The Begin/Accept pair contains Lock()/ Unlock() calls, so operations that change attributes within a Begin/Accept pair do not need an explicit Lock/ Unlock.

Note that Lock() is made to wait by any in-progress user-initiated operation, which may potentially take an unlimited period of time. Lock() will also have to wait if the user has a mouse- button down, for example to drag something.

You should be sure to encompass all related operations within a Lock/Unlock pair. For example, if you request the number of trackers, then begin doing something to them, you should include the access to the number of trackers in the locked portion, in case the user adds or deletes a tracker simultaneous with the start of your operation. This is less an issue for user-initiated python scripts.


©2023 Boris FX, Inc. — UNOFFICIAL — Converted from original PDF.