脏读:A 1检索a 2未提交的数据。
理想情况下,多个线程不能同时访问同一块数据,脏读将不复存在,死锁则会被自动监测和处理。
Ideally no two threads can try to modify the same piece of data at the same time, dirty reads are not possible, and deadlocks are automatically detected and handled.
SQL 2005有一个 基于快照的隔离级别 ,它能在不允许“脏读”的情况下避免数据读取阻塞数据写入,或者数据写入阻塞数据读取。
SQL 2005 has snapshot-based isolation levels that prevent readers from blocking writers or writers from blocking readers without allowing dirty reads.
一个写线程释放一个锁之后,另一个读线程随后获取了同一个锁。本质上,线程释放锁时会将强制刷新工作内存中的脏数据到主内存中,获取一个锁将强制线程装载(或重新装载)字段的值。
In essence, releasing a lock forces a flush of all writes from working memory employed by the thread, and acquiring a lock forces a (re) load of the values of accessible fields.
一个写线程释放一个锁之后,另一个读线程随后获取了同一个锁。本质上,线程释放锁时会将强制刷新工作内存中的脏数据到主内存中,获取一个锁将强制线程装载(或重新装载)字段的值。
In essence, releasing a lock forces a flush of all writes from working memory employed by the thread, and acquiring a lock forces a (re) load of the values of accessible fields.
应用推荐