TAILIEUCHUNG - Programming C# 4.0 phần 5

Bởi vì class DynamicObject không cho phép chúng ta hiện thực các đối tượng trực tiếp, do đó chúng ta bắt buộc phải thực hiện việc định nghĩa một class được thừa kế từ DynamicObject và override các phương thức cần thiết. | while current null if current else break _ if current null newPatient else current newPatient This code adds the new patient after all those patients in the queue whose lives appear to be at immediate risk but ahead of all other patients the patient is presumably either quite unwell or a generous hospital benefactor. Real triage is a little more complex of course but you still insert items into the list in the same way no matter how you go about choosing the insertion point. Note the use of LinkedListNode T this is how LinkedList T presents the queue s contents. It allows us not only to see the item in the queue but also to navigate back and forth through the queue with the Next and Previous properties. Stacks Whereas Queue T operates a FIFO order Stack T operates a last in first out LIFO order. Looking at this from a queuing perspective it seems like the height of unfairness latecomers get priority over those who arrived early. However there are some situations in which this topsy-turvy ordering can make sense. A performance characteristic of most computers is that they tend to be able to work faster with data they ve processed recently than with data they ve not touched lately. CPUs have caches that provide faster access to data than a computer s main memory can support and these caches typically operate a policy where recently used data is more likely to stay in the cache than data that has not been touched recently. If you re writing a server-side application you may consider throughput to be more important than fairness the total rate at which you process work may matter more than how long any individual work item takes to complete. In this case a LIFO order may make the most sense work items that were only just put into a queue are much more likely to still live in the CPU s cache than those that were queued up ages ago Stacks 313 and so you ll get better .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.