TAILIEUCHUNG - A ‘ringbuffer’ application

A ‘ringbuffer’ application is Devices might be ‘idle', Devices might be ‘busy’, Avoid ‘busy waiting’, ‘blocking’ while idle, ‘run’ queues and ‘wait’ queues, Kernel waitqueues, Kernel’s support routines, Use of Linux wait queues. | A ‘ringbuffer’ application Introduction to process ‘blocking’ and the Linux kernel’s support for ‘sleeping’ and ‘waking’ Devices might be ‘idle’ • With our previous device-driver examples (., dram, cmosram), the data to be read was already there, just waiting to be input • But with certain other character devices, such as a keyboard, a program may want to input its data before any new data has actually been entered by a user • In such cases we prefer to wait until data arrives rather than to abandon reading Devices might be ‘busy’ • Sometimes an application wants to ‘write’ some data to a character device, such as a printer, but the device temporarily is not able to accept more data, being still busy with processing previously written data • Again, in such situations we prefer to just wait until the device becomes ready for us to send it more data rather than to give up We could do ‘busy waiting’ • It is possible for a device-driver to ‘poll’ a status-bit continuously until data is ready, (or until a device is no longer “too busy”): do { status = inb( 0x64 ); } while ( ( status & READY ) == 0 ); • Such a technique is called ‘busy waiting’ • But it could waste a lot of valuable CPU time before any benefit was realized! Avoid ‘busy waiting’ • In a multitasking system we would want to avoid having any processes use the ‘busy waiting’ strategy whenever possible, as it ‘stalls’ any progress by other tasks – it’s a system-performance ‘bottleneck’! • So modern operating systems support an alternative strategy, which allows those tasks that could proceed to do .

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.