protected override void DoAccess(uint pageid, byte[] resultOrData, AccessType type) { LinkedListNode<IFrame> node; FrameWSR frame; if (map.TryGetValue(pageid, out node)) { frame = node.Value as FrameWSR; list.Remove(node); frame.cold = 0; } else { frame = new FrameWSR(pageid); } PerformAccess(frame, resultOrData, type); node = list.AddFirst(frame); map[pageid] = node; }
protected override void DoAccess(uint pageid, byte[] resultOrData, AccessType type) { LinkedListNode<IFrame> node; FrameWSR frame; if (map.TryGetValue(pageid, out node)) { frame = node.Value as FrameWSR; node.List.Remove(node);//不管在哪都先拿出来再放到好的位置 frame.cold = 0; } else { frame = new FrameWSR(pageid); frame.cold = COLDMAX; } PerformAccess(frame, resultOrData, type); if (frame.cold >= COLDMAX && !frame.Dirty)//是cold clean node = cclist.AddFirst(frame); else node = list.AddFirst(frame); map[pageid] = node; }