CN115328564B - Asynchronous input/output thread processor resource allocation method and device - Google Patents

Asynchronous input/output thread processor resource allocation method and device Download PDF

Info

Publication number
CN115328564B
CN115328564B CN202211264580.6A CN202211264580A CN115328564B CN 115328564 B CN115328564 B CN 115328564B CN 202211264580 A CN202211264580 A CN 202211264580A CN 115328564 B CN115328564 B CN 115328564B
Authority
CN
China
Prior art keywords
thread
output
input
state
asynchronous
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211264580.6A
Other languages
Chinese (zh)
Other versions
CN115328564A (en
Inventor
李锐喆
赵彤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Carpura Technology Co ltd
Original Assignee
Beijing Carpura Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Carpura Technology Co ltd filed Critical Beijing Carpura Technology Co ltd
Priority to CN202211264580.6A priority Critical patent/CN115328564B/en
Publication of CN115328564A publication Critical patent/CN115328564A/en
Application granted granted Critical
Publication of CN115328564B publication Critical patent/CN115328564B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a resource allocation method and a device of an asynchronous input/output thread processor, and relates to the technical field of computers, wherein the method comprises the steps of judging whether an asynchronous input/output request to be processed exists currently, and if the asynchronous input/output request to be processed does not exist currently, controlling an input/output special thread to enter a first dormant state; and when the input/output special thread is in the first dormant state, if an asynchronous input/output request initiated by an application program is received, controlling the input/output special thread to be converted from the first dormant state to an active state. The asynchronous input/output thread processor resource allocation method provided by the invention can enable the input/output special thread to enter the first dormant state when no asynchronous input/output request to be processed exists, avoid invalid occupation of processor resources and improve the overall efficiency of an application program.

Description

Asynchronous input/output thread processor resource allocation method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for allocating resources of an asynchronous input/output thread processor.
Background
With the continuous enhancement of data processing capability of computers and the continuous enhancement of demands of various applications, the calculation amount of data processing by application programs is also continuously increased, and accordingly, the amount of data Input or Output (I/O) from a file system is also continuously increased. Since the rate of increase of I/O data transfer capacity is slower than the rate of increase of computing capacity, data I/O speed is a performance bottleneck for application operation in many scenarios.
To reduce the impact of I/O overhead, parallel I/O techniques or asynchronous I/O techniques may be used. The parallel I/O technology can fully utilize the parallel storage capacity of the computer, dispersedly store the data of the application program on a plurality of processes, and cooperatively read and write the file data by the plurality of processes, thereby improving the data read-in-write transmission speed. Chinese patent CN114138381, for example, discloses a numerical program processing system for synchronous/asynchronous parallel reading in/writing out of multidimensional variables for distributed computation, but there may be an overlap of I/O processes and computation processes in a parallel arrangement. The asynchronous I/O technology uses an I/O special process or thread except a computer process or thread to complete data read-in, write-out and transmission, so that an application program can execute other calculations without waiting for the completion of I/O operation, the two processes can be overlapped and simultaneously performed, and the whole time consumption is shortened. On the basis, the parallel asynchronous I/O method taking the parallel I/O technology and the asynchronous I/O technology into consideration can further reduce the influence of I/O overhead on the running speed of the application program.
Current asynchronous I/O technology mainly includes two implementation approaches, one using dedicated I/O processes and one using dedicated I/O threads. The I/O special process is an independent process except the original computing process of the application program, and when the application program is started to run, additional independent computing resources are required to be allocated to each I/O process. And each special I/O thread is automatically created by the computing process of the application program according to the requirement, so that independent computing resources are not required to be allocated to the I/O special thread when the application program is submitted. Although the dedicated thread does not need to allocate additional computing resources compared to the dedicated process, the I/O dedicated thread competes with the application computing thread for use of processor resources, bringing new overhead to program operation.
Disclosure of Invention
In order to solve the problem that the existing asynchronous input/output thread data transmission mode occupies larger processor resources, the application provides an asynchronous input/output thread processor resource allocation method, so that the processor resource cost of data reading and writing can be sufficiently reduced.
In one aspect, a method for allocating resources of an asynchronous input/output thread processor is provided, including:
judging whether an asynchronous input/output request to be processed exists currently, and if the asynchronous input/output request to be processed does not exist currently, controlling the special input/output thread to enter a first dormant state;
and when the input/output special thread is in the first dormant state, if an asynchronous input/output request initiated by an application program is received, controlling the input/output special thread to be converted from the first dormant state to an active state.
In another aspect, an apparatus for asynchronous input output thread processor resource allocation is provided, the apparatus comprising:
the first dormancy control module is used for judging whether an asynchronous input/output request to be processed exists currently, and if the asynchronous input/output request to be processed does not exist currently, controlling the special input/output thread to enter a first dormancy state;
and the first dormancy transition module is used for controlling the input/output special thread to transition from the first dormancy state to the active state if an asynchronous input/output request initiated by an application program is received when the input/output special thread is in the first dormancy state.
In another aspect, a computer device is provided, where the computer device includes a processor and a memory, where the memory stores at least one instruction, at least one program, a code set, or an instruction set, and where the processor may load and execute the at least one instruction, the at least one program, the code set, or the instruction set to implement the asynchronous input/output thread processor resource allocation method provided in the foregoing embodiments.
In another aspect, a computer readable storage medium is provided, where at least one instruction, at least one program, code set, or instruction set is stored, and a processor can load and execute the at least one instruction, at least one program, code set, or instruction set, so as to implement the asynchronous input/output thread processor resource allocation method provided in the foregoing embodiment.
In another aspect, a computer program product or computer program is provided, the computer program title or computer program comprising computer program instructions stored in a computer readable storage medium. The processor reads the computer instructions from the computer-readable storage medium and executes the computer instructions to cause the computer device to perform the asynchronous input/output thread processor resource allocation method described in the above embodiments.
The beneficial effects that this application provided technical scheme brought include at least: the embodiment of the invention provides a resource allocation method of an asynchronous input/output thread processor, which comprises the steps of judging whether an asynchronous input/output request to be processed exists currently, and controlling an input/output special thread to enter a first dormant state if the asynchronous input/output request to be processed does not exist currently; and when the input/output special thread is in the first dormant state, if an asynchronous input/output request initiated by an application program is received, controlling the input/output special thread to be converted from the first dormant state to an active state. The method provided by the embodiment of the invention can enable the input and output special thread to enter the first dormant state when the asynchronous input/output request to be processed is not available, avoid invalid occupation of processor resources and improve the overall efficiency of the application program.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart illustrating an implementation of a method for allocating resources in an asynchronous input/output thread processor according to an exemplary embodiment of the present application;
FIG. 2 illustrates a block diagram of an asynchronous input/output thread processor distribution device according to one exemplary embodiment of the present application;
fig. 3 is a schematic structural diagram of a computer device corresponding to an asynchronous input/output thread processor allocation method according to an exemplary embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Conventional use of dedicated I/O processes or dedicated I/O threads may occupy significant processor resources. In a specific example, if an application program uses 1024 processes/processor cores for parallel computation, 16I/O processes are used, 1040 processes/processor cores, that is, the sum of the number of original processes/processor cores and I/O processes, need to be applied when the application program is submitted. If the application uses 16I/O threads, 1024 processes/processor cores are still required to be applied when the application is submitted.
New overhead is incurred when I/O dedicated threads compete with application computing threads for use of processor resources. For example, when 64 computing threads are running on a computing node of 64 processor cores, and one I/O-specific thread is generated, the I/O-specific thread competes with the 64 computing threads for use of the 64 processor cores. When the I/O special thread and 64 computing threads are fully loaded, the processor resources are not actively released, and the operating system can only enable 65 threads to share 64 processor cores in a time sharing way through scheduling and thread context switching. In this case, the I/O dedicated thread would incur an overhead of about 1/64. And the data read-write operation which is responsible for the I/O special thread is finally completed by the special process/thread of the operating system, and the special process/thread of the operating system occupies the processor resource and brings certain expenditure.
The asynchronous input/output thread processor resource allocation method provided by the application program can reasonably allocate processor resources between the input/output special thread and the computing thread of the application program, and improves the overall efficiency of the application program.
Embodiment 1,
FIG. 1 is a flow chart illustrating an implementation of a method for allocating resources in an asynchronous input/output thread processor according to an exemplary embodiment.
Referring to fig. 1, a method provided by an embodiment of the present invention may include steps 101 to 102.
Step 101: judging whether an asynchronous input/output request to be processed exists currently, and if the asynchronous input/output request to be processed does not exist currently, controlling the special input/output thread to enter a first dormant state.
Specifically, in an asynchronous I/O system, outstanding asynchronous I/O requests are placed in an asynchronous I/O request queue.
In some embodiments, the specific implementation procedure of step 101 may include:
and acquiring an unprocessed asynchronous I/O request corresponding to the I/O special thread, and if the unprocessed asynchronous I/O request is not found, enabling the I/O special thread to enter a first dormant state.
Therefore, the asynchronous I/O thread processor allocation method provided by the embodiment of the invention can switch from the active state to the dormant state after the I/O special thread tries to acquire the unprocessed I/O request.
Step 102: and when the input/output special thread is in the first dormant state, if an asynchronous input/output request initiated by an application program is received, controlling the input/output special thread to be converted from the first dormant state to an active state.
In some embodiments, the implementation of step 102 may include:
when the I/O dedicated thread is in the first sleep state, the I/O dedicated thread is restored to an active state in response to an asynchronous I/O request by the application.
It can be seen that the asynchronous I/O thread processor allocation method provided by the embodiment of the present invention may switch from the first sleep state to the active state when an application initiates a new asynchronous I/O request.
In this embodiment, the sleep state is a state of putting the thread into sleep, or blocking, state, where the thread may leave the processor resources unused. The active state is a state other than the sleep state, when the thread occupies processor resources.
The asynchronous I/O thread processor allocation method provided by the embodiment of the invention can enable the I/O special thread to actively release the processor resource when waiting, and re-occupy the processor resource when waiting is finished, thereby avoiding invalid occupation or waste of the processor resource and improving the overall efficiency of the application program.
In some embodiments, controlling the input-output specific thread to enter a first sleep state and controlling the input-output specific thread to transition from the first sleep state to an active state in steps 101 and 102 includes:
the method further comprises enabling the control input-output dedicated thread to enter a first sleep state and the control input-output dedicated thread to transition from the first sleep state to an active state based on the operation and release operations.
In particular, switching of the I/O dedicated thread between the first dormant state and the active state may be based on a pass-through and release (Passeren Vrijgeven, PV) operation, which includes the steps of applying for resources and releasing resources.
For example, when an I/O dedicated thread attempts to obtain an I/O request that has not yet been processed, a P operation on the asynchronous I/O request queue semaphore is first performed, and if the asynchronous I/O request queue is empty at this time, the P operation may cause the I/O dedicated thread to enter a first sleep state.
When an application initiates a new asynchronous I/O request, the computing thread corresponding to the I/O dedicated thread may perform a V operation with respect to the semaphore of the asynchronous I/O request queue, the V operation may cause the I/O dedicated thread to enter an active state from the first sleep state.
In some embodiments, the method for allocating resources of an asynchronous input/output thread processor provided by the embodiment of the present invention may further include step 201 and step 202.
Step 201: judging whether an ongoing file read-write operation exists currently, and if the ongoing file read-write operation exists currently, controlling the special input-output thread to enter a second dormant state.
Step 202: and when the input-output special thread is in the second dormant state, controlling the input-output special thread to be converted into an active state from the second dormant state when the file read-write operation is completed.
Specifically, when the I/O dedicated thread uses the MPI-I/O or the corresponding function of the operating system to read and write file data, the I/O dedicated thread needs to enter a second dormant state, and the active state is restored after the data reading and writing are completed.
From the above steps 101 to 102 and steps 201 to 101, the I/O dedicated thread enters a waiting state when there is no task to be done or other functions are used for reading and writing file data. One is when an I/O-specific thread gets an outstanding asynchronous I/O request, and discovers that the request queue is an empty queue, indicating that there is no task to do, and waits for the application to initiate a new asynchronous I/O request. Another case is that the I/O dedicated thread performs file data reading and writing by using the MPI-I/O or the corresponding function of the operating system, and the I/O dedicated thread needs to wait for the completion of data reading and writing.
In the method provided by the embodiment of the invention, the switching of the I/O special thread between the second dormant state and the active state is not suitable for being realized by using the PV operation. This scenario is difficult to implement because the use of PV operation requires modifications to the operating system's associated programs.
In some embodiments, the controlling the input-output specific thread to enter a second sleep state and the controlling the input-output specific thread to transition from the second sleep state to an active state in step 201 and step 202 includes:
and controlling the input-output special thread to enter a second dormant state based on a process suspending operation and controlling the input-output special thread to be converted into an active state from the second dormant state.
In particular, switching of the I/O dedicated thread between the second sleep state and the active state may be implemented based on a process suspension function of the system. In a specific embodiment, the functions used by the process suspension function may include sleep functions and/or useep functions, such that a thread may sleep itself for a specified length of time and automatically resume active state after the specified length of time has been reached.
In some embodiments, the suspension time determination process of the process suspension operation includes:
and determining the suspension time of the process suspension operation based on a preset suspension time threshold and/or the data size of the read-write operation.
In one particular example, the length of time that an I/O dedicated thread can be dormant by invoking a sleep or useep function once is determined based on a preset length of time threshold. And after the I/O special thread sleeps for a preset time, the second sleep state is restored to the active state.
Further, when the I/O special thread sleeps for a preset time, the file data read-write operation is not completed, and then the sleep or usleep function is called again, so that the I/O special thread maintains the second sleep state.
In one specific example, based on the size of the data to be read and written, the time required for the current read and write task is predicted, and a sleep or useep function is called based on the predicted time to sleep the I/O dedicated thread for the predicted length of time.
Specifically, the prediction of the sleep time is performed according to the size of the data to be read and written and pre-stored historical time information. For example, if the corresponding historical time information of 200MB data is 100 ms, when the current data size to be read and written is 100MB, the time length of the I/O dedicated thread sleep may be set to be 50 ms.
In a specific example, after the I/O dedicated thread is dormant for a predicted length of time based on the predicted time required for the read-write task, if the file data read-write operation is not completed, the sleep or useep function is called again to maintain the I/O dedicated thread in the second dormant state. Optionally, the length of time for which the I/O-specific thread sleeps is determined based on a preset length of time threshold or length of time predictor.
In some embodiments, the method for allocating resources of an asynchronous input/output thread processor provided by the embodiment of the present invention may further include step 301 and step 302.
Step 301: judging whether the computing thread is waiting for the completion of the asynchronous input/output request currently or not, and if the computing thread is waiting for the incompletely asynchronous input/output request currently, controlling the computing thread to enter a third dormant state.
Step 302: and when the computing thread is in the third dormant state, if all the waiting asynchronous input/output requests are judged to be completed, controlling the computing thread to be converted into an active state from the third dormant state.
Specifically, the I/O dedicated thread and the corresponding computing thread belong to the same computing process, and the I/O dedicated thread is created by the corresponding computing thread. Variable resources are shared between I/O dedicated threads and corresponding computing threads.
The method for allocating the asynchronous I/O thread processor provided by the embodiment of the invention can enable the computing thread of the application program to release the processor resource when the asynchronous I/O request is incomplete, namely the asynchronous I/O thread is in an active state, and occupy the processor resource when the asynchronous I/O request is completed.
In some embodiments, the controlling the computing thread to enter the third sleep state and the controlling the computing thread to transition from the third sleep state to the active state in steps 301 and 302 includes:
the control computing thread enters a third sleep state and the control computing thread transitions from the third sleep state to an active state based on the operating and releasing operations.
In some embodiments, switching of the computing thread between the third sleep state and the active state may likewise be accomplished based on PV operation. Specifically, a shared semaphore is set, wherein the shared semaphore is a shared semaphore between an I/O dedicated thread and a corresponding computing thread. And if the currently-waiting outstanding request comprises an asynchronous I/O request, performing P operation on the shared semaphore so as to enable the computing thread to enter the third dormant state. And after the I/O special thread completes the corresponding asynchronous I/O request, performing V operation on the shared semaphore so as to enable the computing thread to return to an active state.
In summary, the method for allocating asynchronous I/O thread processor provided by the embodiments of the present invention may enable an asynchronous I/O dedicated thread to actively release processor resources when the wait state is completed and to actively use processor resources when the wait state is completed, and on the other hand, enable a computing thread of an application program to actively release processor resources when the asynchronous I/O request is found to be incomplete, and to reuse processor resources after the asynchronous I/O request is completed. Through the above process, in the resource allocation of the application program manager, the asynchronous I/O thread takes priority, namely, the asynchronous I/O thread takes priority over the calculation thread, so that the speed of data reading and writing is fully ensured, the condition that the calculation speed is high but limited by the data transmission speed is avoided, the processor resource is fully utilized, and the overall efficiency of the application program is improved.
Embodiment II,
FIG. 2 is a schematic diagram of an apparatus for allocating resources in an asynchronous input/output thread processor according to an embodiment of the present invention.
Referring to fig. 2, an asynchronous input/output thread processor resource allocation apparatus provided in an embodiment of the present invention includes:
the first sleep control module 201 is configured to determine whether there is an asynchronous input/output request to be processed currently, and if there is no asynchronous input/output request to be processed currently, control the input/output dedicated thread to enter a first sleep state;
the first sleep transition module 202 is configured to, when the input/output dedicated thread is in a first sleep state, control the input/output dedicated thread to transition from the first sleep state to an active state if an asynchronous input/output request initiated by an application is received.
In some embodiments, the controlling the input-output specific thread to enter a first sleep state and the controlling the input-output specific thread to transition from the first sleep state to an active state in the first sleep control module 201 and the first sleep transition module 202 includes:
the method further comprises enabling the control input-output dedicated thread to enter a first sleep state and the control input-output dedicated thread to transition from the first sleep state to an active state based on the operation and release operations.
In some embodiments, the asynchronous input output thread processor resource allocation apparatus may further comprise:
the second dormancy control module is used for judging whether the current file read-write operation exists or not, and if the current file read-write operation exists, the input-output special thread is controlled to enter a second dormancy state;
and the second dormancy transition module is used for controlling the input and output special threads to transition from the second dormancy state to the active state when the file read-write operation is completed when the input and output special threads are in the second dormancy state.
In some embodiments, the controlling the input-output specific thread to enter a second sleep state and the controlling the input-output specific thread to transition from the second sleep state to an active state in a second sleep control module and a second sleep transition module comprises:
and controlling the input-output special thread to enter a second dormant state based on a process suspending operation and controlling the input-output special thread to be converted into an active state from the second dormant state.
In some embodiments, the asynchronous input/output thread processor resource allocation apparatus may further include a suspension time determination module configured to determine a suspension time of the process suspension operation based on a preset suspension time threshold and/or a data size of the read/write operation.
In some embodiments, the asynchronous input output thread processor resource allocation apparatus may further comprise:
the third dormancy control module is used for judging whether the computing thread is waiting for the completion of the asynchronous input/output request currently, and if the computing thread is waiting for the asynchronous input/output request which is not completed currently, the computing thread is controlled to enter a third dormancy state;
and the third sleep transition module is used for controlling the computing thread to transition from the third sleep state to the active state if all the waiting asynchronous input/output requests are judged to be completed when the computing thread is in the third sleep state.
In some embodiments, the controlling the computing thread to enter a third sleep state and the controlling the computing thread to transition from the third sleep state to an active state in the third sleep control module and the third sleep transition module comprises:
the control computing thread enters a third sleep state and the control computing thread transitions from the third sleep state to an active state based on the operating and releasing operations.
In summary, the resource allocation device of the asynchronous input/output thread processor provided by the embodiment of the invention can enable the asynchronous I/O thread to occupy priority, that is, the asynchronous I/O thread takes precedence over the computing thread, so as to fully ensure the speed of data reading and writing, avoid the situation that the computing speed is fast but limited by the data transmission speed, fully utilize the processor resource, and improve the overall efficiency of the application program.
Third embodiment,
Fig. 3 shows a schematic structural diagram of a computer device according to an exemplary embodiment of the present application, where the computer device includes:
processor 301, including one or more processing cores, executes various functional applications and data processing by running software programs and modules by processor 301.
The receiver 302 and the transmitter 303 may be implemented as one communication component, which may be a communication chip. Alternatively, the communication component may be implemented to include a signaling function. That is, the transmitter 303 may be used to transmit control signals to the image acquisition device as well as to the scanning device, and the receiver 3 may be used to receive corresponding feedback instructions.
The memory 304 is connected to the processor 301 by a bus 305.
The memory 304 may be used for storing at least one instruction, and the processor 301 is configured to execute the at least one instruction to implement steps 101 to 102 in the above-described method embodiment.
Fourth embodiment,
The embodiment of the application also provides a computer readable storage medium, wherein at least one instruction, at least one section of program, code set or instruction set is stored in the readable storage medium, so as to be loaded and executed by a processor to realize the asynchronous input/output thread processor resource allocation method.
Fifth embodiment (V),
The present application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium and the processor executes the computer instructions to cause the computer device to perform the asynchronous input/output thread processor resource allocation method according to any of the above embodiments.
Alternatively, the computer-readable storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), solid state disk (SSD, solid State Drives), or optical disk, etc. The random access memory may include resistive random access memory (ReRAM, resistance Random Access Memory) and dynamic random access memory (DRAM, dynamic Random Access Memory), among others.
The foregoing embodiment numbers of the present application are merely for description, and do not represent the advantages and disadvantages of the implementation.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, and the program may be stored in a computer readable storage medium, where the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments is merely exemplary in nature and is not intended to limit the invention, but is intended to cover various modifications, substitutions, improvements, and alternatives falling within the spirit and principles of the invention.

Claims (6)

1. An asynchronous input/output thread processor resource allocation method, comprising:
judging whether an asynchronous input/output request to be processed exists currently, and if the asynchronous input/output request to be processed does not exist currently, controlling the special input/output thread to enter a first dormant state;
when the special input/output thread is in the first dormant state, if an asynchronous input/output request initiated by an application program is received, controlling the special input/output thread to be converted from the first dormant state to an active state;
the method further comprises the steps of:
judging whether an ongoing file read-write operation exists currently, and if so, controlling the special thread for input and output to enter a second dormant state;
when the special thread for input and output is in the second dormant state, when the file read-write operation is completed, the special thread for input and output is controlled to be converted into an active state from the second dormant state;
the controlling the input-output dedicated thread to enter a second sleep state and the controlling the input-output dedicated thread to transition from the second sleep state to an active state includes:
based on a process suspension operation, the input-output special thread is controlled to enter a second dormant state and the input-output special thread is controlled to be converted from the second dormant state to an active state;
the suspension time determination process of the process suspension operation includes:
determining the suspension time of the process suspension operation based on a preset suspension time threshold and/or the data size of the read-write operation;
determining a suspension time of the process suspension operation based on a data size of the read-write operation, comprising:
predicting the suspension time according to the data size of the read-write operation and pre-stored historical time information;
the method further comprises the steps of:
judging whether the computing thread is waiting for the completion of the asynchronous input/output request currently or not, and if the computing thread is waiting for the incompletely asynchronous input/output request currently, controlling the computing thread to enter a third dormant state;
and when the computing thread is in the third dormant state, if all the waiting asynchronous input/output requests are judged to be completed, controlling the computing thread to be converted into an active state from the third dormant state.
2. The method of claim 1, wherein the controlling the input-output specific thread to enter a first sleep state and the controlling the input-output specific thread to transition from the first sleep state to an active state comprises:
based on the through operation and the release operation, the control of the input-output special thread to enter a first dormant state and the control of the input-output special thread to transition from the first dormant state to an active state are realized.
3. The method of claim 1, wherein the control computing thread entering a third sleep state and the control computing thread transitioning from the third sleep state to an active state comprises:
the control computing thread enters a third sleep state and the control computing thread transitions from the third sleep state to an active state based on the operating and releasing operations.
4. An asynchronous input/output thread processor resource allocation apparatus, the apparatus comprising:
the first dormancy control module is used for judging whether an asynchronous input/output request to be processed exists currently, and if the asynchronous input/output request to be processed does not exist currently, controlling the special input/output thread to enter a first dormancy state;
the first sleep transition module is used for controlling the input/output special thread to transition from the first sleep state to the active state if an asynchronous input/output request initiated by an application program is received when the input/output special thread is in the first sleep state;
the second dormancy control module is used for judging whether the current file read-write operation exists or not, and if the current file read-write operation exists, the input-output special thread is controlled to enter a second dormancy state; the second sleep control module is specifically configured to implement the controlling, based on a process suspension operation, the input/output dedicated thread to enter a second sleep state;
the second sleep transition module is used for controlling the input/output special thread to transition from the second sleep state to the active state when the file read-write operation is completed when the input/output special thread is in the second sleep state; the second sleep transition module is specifically configured to control the input-output dedicated thread to transition from the second sleep state to an active state based on a process suspension operation;
the second sleep transition module is further configured to: determining the suspension time of the process suspension operation based on a preset suspension time threshold and/or the data size of the read-write operation; determining a suspension time of the process suspension operation based on a data size of the read-write operation, comprising: predicting the suspension time according to the data size of the read-write operation and pre-stored historical time information;
the third dormancy control module is used for judging whether the computing thread is waiting for the completion of the asynchronous input/output request currently, and if the computing thread is waiting for the asynchronous input/output request which is not completed currently, the computing thread is controlled to enter a third dormancy state;
and the third sleep transition module is used for controlling the computing thread to transition from the third sleep state to the active state if all the waiting asynchronous input/output requests are judged to be completed when the computing thread is in the third sleep state.
5. A computer device comprising a processor and a memory having stored therein at least one instruction, at least one program, code set, or instruction set that is loaded and executed by the processor to implement the asynchronous input/output thread processor resource allocation method of any of claims 1 to 3.
6. A computer readable storage medium having stored therein at least one instruction, at least one program, code set, or instruction set that is loaded and executed by a processor to implement the asynchronous input/output thread processor resource allocation method of any of claims 1 to 3.
CN202211264580.6A 2022-10-17 2022-10-17 Asynchronous input/output thread processor resource allocation method and device Active CN115328564B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211264580.6A CN115328564B (en) 2022-10-17 2022-10-17 Asynchronous input/output thread processor resource allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211264580.6A CN115328564B (en) 2022-10-17 2022-10-17 Asynchronous input/output thread processor resource allocation method and device

Publications (2)

Publication Number Publication Date
CN115328564A CN115328564A (en) 2022-11-11
CN115328564B true CN115328564B (en) 2023-04-25

Family

ID=83915497

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211264580.6A Active CN115328564B (en) 2022-10-17 2022-10-17 Asynchronous input/output thread processor resource allocation method and device

Country Status (1)

Country Link
CN (1) CN115328564B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115718665B (en) * 2023-01-10 2023-06-13 北京卡普拉科技有限公司 Asynchronous I/O thread processor resource scheduling control method, device, medium and equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105487987A (en) * 2015-11-20 2016-04-13 深圳市迪菲特科技股份有限公司 Method and device for processing concurrent sequential reading IO (Input/Output)
CN106648851A (en) * 2016-11-07 2017-05-10 郑州云海信息技术有限公司 IO management method and device used in multi-controller storage

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1801101A (en) * 2006-01-17 2006-07-12 浙江大学 Thread implementation and thread state switching method in Java operation system
CN103442204A (en) * 2013-08-08 2013-12-11 浙江工业大学 Network video transmission system and method based on DM365
US11785543B2 (en) * 2019-07-03 2023-10-10 Qualcomm Incorporated Methods and apparatus to facilitate sleep mechanisms for read-only mode devices in a dedicated carrier
CN114138381B (en) * 2022-01-30 2022-06-03 北京卡普拉科技有限公司 Processing system of numerical program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105487987A (en) * 2015-11-20 2016-04-13 深圳市迪菲特科技股份有限公司 Method and device for processing concurrent sequential reading IO (Input/Output)
CN106648851A (en) * 2016-11-07 2017-05-10 郑州云海信息技术有限公司 IO management method and device used in multi-controller storage

Also Published As

Publication number Publication date
CN115328564A (en) 2022-11-11

Similar Documents

Publication Publication Date Title
US9135060B2 (en) Method and apparatus for migrating task in multicore platform
US10990540B2 (en) Memory management method and apparatus
CN111052149B (en) Method and apparatus for determining memory requirements in a network
EP0697654B1 (en) Load distribution method and system
US5867704A (en) Multiprocessor system shaving processor based idle state detection and method of executing tasks in such a multiprocessor system
US9052957B2 (en) Method and system for conducting intensive multitask and multiflow calculation in real-time
CN108228343B (en) Memory recovery method and device, computer device and computer readable storage medium
US20110107344A1 (en) Multi-core apparatus and load balancing method thereof
US20110265093A1 (en) Computer System and Program Product
CN115328564B (en) Asynchronous input/output thread processor resource allocation method and device
US20190227918A1 (en) Method for allocating memory resources, chip and non-transitory readable medium
CN114610472B (en) Multi-process management method in heterogeneous computing and computing equipment
US10521371B2 (en) Cache system and associated method
CN110162396A (en) Method for recovering internal storage, device, system and storage medium
CN112667380A (en) Multiprocessor task scheduling method, device and storage medium
JP2007188523A (en) Task execution method and multiprocessor system
CN113934516A (en) Lock management method, device and equipment
CN112925616A (en) Task allocation method and device, storage medium and electronic equipment
CN116841739B (en) Data packet reuse system for heterogeneous computing platforms
US20050223383A1 (en) Methods and apparatus for reserving an execution thread
CN113296957B (en) Method and device for dynamically distributing network bandwidth on chip
JP2014078214A (en) Schedule system, schedule method, schedule program, and operating system
CN114116220A (en) GPU (graphics processing Unit) sharing control method, GPU sharing control device and storage medium
CN116450328A (en) Memory allocation method, memory allocation device, computer equipment and storage medium
CN115712337A (en) Scheduling method and device of processor, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant