A read-write testing method for a memory storage device, comprising:
- obtaining a number of data blocks of a target memory storage device to be tested and a number of rows in each of the data blocks;
- determining a number of test threads to be created based on the number of data blocks, the number of rows, and the read-write type;
- creating the number of test threads and determining read-write starting positions for each of the test threads from row regions of each of the data blocks;
- synchronously invoking each of created test threads and outputting the test results, so as to perform synchronous read-write testing from corresponding read-write starting positions through each of the test threads;
- wherein the test threads comprise read threads, write threads, and comparison threads;
- the read threads, the write threads, and the comparison threads are provided in a one-to-one correspondence;
- wherein multiple read-write types are provided, and the multiple read-write types comprise block-by-block read-write and multi-block read-write;
- the determining the number of test threads to be created based on the number of data blocks, the number of rows, and the read-write type, comprises:
- determining a first number of threads corresponding to block-by-block read-write based on the number of rows, wherein each test thread corresponds to the row region of at least one row;
- obtaining the maximum number of write threads that are created;
- the maximum number of writable threads is one-third of the supported maximum number of threads;
- dividing the maximum number of write threads by the number of data blocks and rounding down the result to determine the first thread multiple when the maximum number of write threads is greater than or equal to the number of data blocks;
- determining the number of data block write threads for a single data block based on the first thread multiple;
- determining the target number of write threads based on the number of data block write threads and the number of data blocks;
- determining the second number of threads corresponding to multi-block read-write based on the target number of write threads;
- determining a number of threads based on the first number of threads and the second number of threads.
- wherein the synchronously invoking each of the created test threads and outputting the test results, comprises:
- invoking each of the write threads to perform write operations from the corresponding read-write starting positions;
- invoking each of the read threads to perform read operations from the read-write starting positions after the data at each of the read-write starting positions has been written;
- invoking the comparison threads to compare the operation data of the corresponding write threads and read threads and output the comparison results.