Pessimistic Concurrency Control (OCC)

Pessimistic concurrency control involves locking resources to prevent conflicts between multiple concurrent transactions. This approach assumes that conflicts are likely to occur and tries to prevent them from happening.

Pros:

  • Provides strong consistency guarantees

  • Prevents conflicts before they occur, reducing the likelihood of rollbacks

  • Suitable for systems with high contention and low throughput

Cons:

  • Can lead to blocking and reduced concurrency if there are many conflicts

  • Can lead to deadlock if locks are not released properly

  • Can reduce system performance if locks are held for a long time.

In blockchain environments, pre-declaring resources can pose challenges due to the inherent difficulty in accurately predicting which states will be accessed during transaction execution. Consequently, resource declarations often need to be coarse-grained, potentially limiting concurrency in many scenarios.

Last updated