tailieunhanh - Practical Statecharts in C/C++ Quantum Programming for Embedded Systems phần 10

Phương pháp thực nghiệm có lẽ là kỹ thuật đơn giản và phổ biến nhất được sử dụng để xác định năng lực cần thiết của hàng đợi sự kiện, hoặc bất kỳ bộ đệm khác cho rằng vấn đề (ví dụ, thực hiện ngăn xếp). Kỹ thuật này liên quan đến việc chạy các hệ thống trong một thời gian và sau đó dừng lại để kiểm tra bao nhiêu bộ đệm khác nhau | The empirical method is perhaps the simplest and most popular technique used to determine the required capacity of event queues or any other buffers for that matter . execution stacks . This technique involves running the system for a while and then stopping it to examine how much of various buffers has been used. The QF implementation of the event queue the QEQueue class maintains the attribute myNmax specifically for this purpose see Listing in Chapter 9 . You can inspect this high-water mark easily using a debugger or through a memory dump see Exercise . Is this value however a good measure of the required capacity Perhaps not because seconds or minutes after the end of the experiment event production can increase dramatically. Even if you apply a fudge factor such as adding 30 percent extra capacity you cannot absolutely trust the empirical method Kalinsky 01 . The alternative technique relies on a static analysis of event production and event consumption. The QF uses event queues in a rather specific way . there is only one consumer thread consequently the production rate P t and the consumption rate C t are strongly correlated. For example consider a QF application running under a preemptive prioritybased scheduler. 10 Assume further that the highest priority active object receives events only from other active objects but not from ISRs . Whenever any of the lower priority active objects publishes an event for the highest priority object the scheduler immediately assigns the CPU to the recipient. The scheduler makes the context switch because at this point the recipient is the highest priority thread ready to run. The highest priority active object awakens and runs to completion consuming any event published for it. Therefore the highest priority active object really doesn t need to queue events the maximum length of its event queue is 1 . Exercise The Table active object from the DPP application is the highest priority active object that

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã 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.