《多处理器编程的艺术》的原文摘录

  • 举个例子,如果你在星期一存入工资,但是由于银行在提款后重排了存款的顺序,导致到下一个星期五才退出资金收据,这将使你感到非常恼火。 (查看原文)
    ligand 2回复 2赞 2015-02-20 18:26:30
    —— 引自第36页
  • For example, we might be unhappy if we deposit our paycheck on Monday, but the bank bounces our rent check the following Friday because it reordered our deposit after your withdrawal. (查看原文)
    ligand 2回复 2赞 2015-02-20 18:26:30
    —— 引自第36页
  • the TASLock performs very poorly, and the TTASLock performance, while substantially better, still falls far short of the ideal. (查看原文)
    红色有角F叔 2014-05-05 10:26:57
    —— 引自章节:Spin Locks and Contention
  • Now consider the behavior of the TTASLock algorithm while the lock is held by a thread A. The first time thread B reads the lock it takes a cache miss, forcing B to block while the value is loaded into B's cache. As long as A holds the lock, B repeatly reread the value, but hits in the cache every time. (查看原文)
    红色有角F叔 2014-05-05 10:26:57
    —— 引自章节:Spin Locks and Contention
  • This notion of local spinning, where threads repeatly reread cached values instead of repeatedly using the bus, is an important principle critical to the design of efficeient spin locks. Here is a key observation: if some other thread aquires the lock between hte first and second step, then, most likely, there is high conteniton for that lock. the larger the number of unsuccessful tries, the higher the likely contention, and the longer the thread should back off . backing off is common to several locking algorithms. the BackoffLock is easy to implement, and typically performs significantly better than TASLock on many architectures. (查看原文)
    红色有角F叔 2014-05-05 10:26:57
    —— 引自章节:Spin Locks and Contention