How can we verify that asynchronous I/O is being used?

本文档详细解释了在Red Hat Enterprise Linux 5中启用oracle参数filesystemio_option以使用异步I/O的过程。文中说明无需额外的内核或文件系统选项设置即可支持AIO,并提供了通过检查/proc/sys/fs/aio-nr文件来验证AIO是否正在使用的具体方法。

https://access.redhat.com/solutions/69753

 SOLUTION UNVERIFIED - 已更新 2018年十二月24日20:13 - 

English 

环境

  • Red Hat Enterprise Linux 5

问题

  • Enabled oracle parameter filesystemio_option="SetAll" to enable use of asynchronous I/O.
  • What additional kernel/filesystem parameter or option is required for support of AIO?
  • How can we verify that asynchronous I/O is actually being used?

决议

  • There are no additional kernel or fileystem options to set for AIO use. The application will change to utilize the appropriate AIO calls to effect the change.

  • You can verify that AIO is being utilized via the file /proc/sys/fs/aio-nr. When the AIO application is running and using asynchronous IO, the content of this file will be non-zero.

#include <reg52.h> // ?????? sbit Green_LED = P2^0; // ????LED?? sbit Red_LED = P2^1; // ????LED?? sbit Buzzer = P2^2; // ??????? sbit Motor = P2^3; // ???????? unsigned char Password[6]; // ????????? unsigned char Correct_Password[6] = {1, 2, 3, 4, 5, 6}; // ???? unsigned char Error_Count = 0; // ???? void delay(unsigned int ms) { unsigned int i, j; for (i = 0; i < ms; i++) for (j = 0; j < 120; j++); } // ???????? unsigned char Matrix_Keyboard_Scan() { unsigned char row, col; unsigned char scan1, scan2; P1 = 0x0F; // ?????? scan1 = P1; // ????? if ((scan1 & 0xF0) != 0xF0) { // ????????? delay(10); // ??? scan1 = P1; if ((scan1 & 0xF0) != 0xF0) { for (row = 0; row < 4; row++) { P1 = ~(0x01 << row); // ???? for (col = 0; col < 4; col++) { if (!(P1 & (0x10 << col))) { // ????? return row * 4 + col + 1; // ????? } } } } } return 0; // ???????0 } // ?????? void Input_Password() { unsigned char i = 0; unsigned char key; while (i < 6) { key = Matrix_Keyboard_Scan(); if (key != 0) { Password[i++] = key; // ????? Display_Digit(key); // ??????? delay(200); // ?????? } } } // ??????? void Display_Digit(unsigned char digit) { static unsigned char disp_code[] = {0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8, 0x80, 0x90}; // ????? P0 = disp_code[digit - 1]; // ?????? delay(500); // ???? } // ?????? void Verify_Password() { unsigned char i; unsigned char match = 1; for (i = 0; i < 6; i++) { if (Password[i] != Correct_Password[i]) { match = 0; break; } } if (match) { // ???? Display_Digit('U'); // ?? 'U' Display_Digit('N'); // ?? 'N' Display_Digit('L'); // ?? 'L' Display_Digit('O'); // ?? 'O' Display_Digit('C'); // ?? 'C' Display_Digit('K'); // ?? 'K' Green_LED = 1; // ????LED Motor = 1; // ?????? delay(1000); // ??1? Green_LED = 0; // ????LED Motor = 0; // ?????? } else { // ???? Error_Count++; if (Error_Count <= 5) { Display_Digit('L'); // ?? 'L' Display_Digit('O'); // ?? 'O' Display_Digit('C'); // ?? 'C' Display_Digit('K'); // ?? 'K' Red_LED = 1; // ????LED for (i = 0; i < 5; i++) { Buzzer = 1; // ???? delay(200); Buzzer = 0; // ????? delay(200); } Red_LED = 0; // ????LED } else { // ??5??? UART_Send("Warning: Too many failed attempts!"); // ?????? Error_Count = 0; // ?????? } } } // UART???? void UART_Send(char *str) { while (*str) { SBUF = *str++; // ???? while (TI == 0); // ?????? TI = 0; // ?????? } } void main() { while (1) { Input_Password(); // ???? Verify_Password(); // ???? } }修改以上程序
06-18
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值