Isolation Levels and Locking

Concurrency

  • Concurrency can be defined as the ability of multiple processes to access or change shared data at the same time.
  • Pessimistic (悲观)concurrency:
    The system behaves pessimistically and assumes that a conflict will occur.
    Readers block writers and writer's block readers in a pessimistic concurrency environment.
  • Optimistic (乐观)concurrency:
    the system has few enough conflicting data modification operations that any single transaction is unlikely to modify data that another transaction is modifying.
    Readers don’t block writers, and writers don’t block readers. Writers can and will block writers, however, which is what causes conflicts.

In either concurrency model, a conflict can occur if two processes try to modify the same data at the same time. The difference between the two models lies in whether conflicts can be avoided before they occur or can be dealt with in some manner after they occur.
Isolation Levels and Locking

上一篇:解决CentOS7时区问题


下一篇:Centos7时间同步Chrony(替代ntp)