Dynamic workload distribution for data processing

A computer-implemented method, according to one embodiment, includes: receiving a data process that includes a plurality of sub-processes. A unique subset of the sub-processes is assigned to each of: a managing thread, and at least one other thread. Moreover, performance characteristics of each of the threads is evaluated while the respective subsets of sub-processes are being performed, and a determination is made as to whether the performance characteristics of each of the threads are substantially equal to the performance characteristics of each of the other threads. In response to determining that performance characteristics of each of the threads are not substantially equal, the subsets of the sub-processes are dynamically adjusted such that the performance characteristics of each of the threads become more equal. Moreover, the adjusted subsets of the sub-processes are reassigned to each of the managing thread and at least one other thread.

BACKGROUND

The present invention relates to data processing, and more specifically, this invention relates to improving performance by dynamically adjusting workload distribution for data processing operations.

Data processes like data sorting generally include processes that involve arranging the data into some meaningful order to make it easier to understand, analyze, visualize, etc. For example, when working with research data, sorting is a common method used for visualizing data in a form that makes it easier to comprehend what the data is representing. While data sorting allows for data to generally be better understood, actually performing the sorting can be a resource intensive process. For instance, operations like data sorting include performing sets of processes in a serial nature, thereby lengthening the time elapsed while attempting to satisfy the processes.

As a result, conventional implementations have experienced a significant consumption of available computing bandwidth when performing such data sorting operations. This is particularly apparent in situations where higher performance storage is utilized to perform at least a portion of the data sorting. While higher performance storage (e.g., such as local cache) provides more desirable performance metrics compared to lower performance storage (e.g., such as external disk), these higher performance metrics are typically paired with lower storage capacity in view of the higher cost associated with the higher performance storage, at least in comparison to the lower performance storage. Accordingly, performance of such conventional systems has significantly been impacted by record processing operations such as data sorting.

SUMMARY

A computer-implemented method, according to one embodiment, includes: receiving a data process at a managing thread, where the data process includes a plurality of sub-processes. A unique subset of the sub-processes is assigned to each of: the managing thread, and at least one other thread. Moreover, each of the subsets of sub-processes are performed by the thread to which the respective subset is assigned, and performance characteristics of each of the threads is evaluated while the respective subsets of sub-processes are being performed. A determination is also made as to whether the performance characteristics of each of the threads are substantially equal to the performance characteristics of each of the other threads. In response to determining that performance characteristics of each of the threads are not substantially equal to the performance characteristics of each of the other threads, the subsets of the sub-processes are dynamically adjusted such that the performance characteristics of each of the threads become more equal. Moreover, the adjusted subsets of the sub-processes are reassigned to each of the managing thread and at least one other thread.

A computer program product, according to another embodiment, includes a computer readable storage medium having program instructions embodied therewith. The program instructions are readable and/or executable by a processor to cause the processor to: perform the foregoing method.

A system, according to yet another embodiment, includes: a processor, and logic that is integrated with the processor, executable by the processor, or integrated with and executable by the processor. Moreover, the logic is configured to: perform the foregoing method.

DETAILED DESCRIPTION

The following description discloses several preferred embodiments of systems, methods, and computer program products for significantly reducing performance times while satisfying data processes. For CPU intensive record processing operations such as key comparisons and data movements, this reduction in achievable performance times is achieved, at least in part, as a result of effectively overlapping I/O processing as much as possible. This increased throughput is achieved by establishing and managing multiple different threads, each of which can be used to satisfy different portions of a data process, e.g., as will be described in further detail below.

In one general embodiment, a computer-implemented method includes: receiving a data process at a managing thread, where the data process includes a plurality of sub-processes. A unique subset of the sub-processes is assigned to each of: the managing thread, and at least one other thread. Moreover, each of the subsets of sub-processes are performed by the thread to which the respective subset is assigned, and performance characteristics of each of the threads is evaluated while the respective subsets of sub-processes are being performed. A determination is also made as to whether the performance characteristics of each of the threads are substantially equal to the performance characteristics of each of the other threads. In response to determining that performance characteristics of each of the threads are not substantially equal to the performance characteristics of each of the other threads, the subsets of the sub-processes are dynamically adjusted such that the performance characteristics of each of the threads become more equal. Moreover, the adjusted subsets of the sub-processes are reassigned to each of the managing thread and at least one other thread.

In another general embodiment, a computer program product includes a computer readable storage medium having program instructions embodied therewith. The program instructions are readable and/or executable by a processor to cause the processor to: perform the foregoing method.

In yet another general embodiment, a system includes: a processor, and logic that is integrated with the processor, executable by the processor, or integrated with and executable by the processor. Moreover, the logic is configured to: perform the foregoing method.

According to some approaches, methods and systems described herein may be implemented with and/or on virtual systems and/or systems which emulate one or more other systems, such as a UNIX® system which emulates an IBM® z/OS® environment (IBM and all IBM-based trademarks and logos are trademarks or registered trademarks of International Business Machines Corporation and/or its affiliates), a UNIX® system which virtually hosts a known operating system environment, an operating system which emulates an IBM® z/OS® environment, etc. This virtualization and/or emulation may be enhanced through the use of VMware® software, in some embodiments.

Now referring toFIG.3, a storage system300is shown according to one embodiment. Note that some of the elements shown inFIG.3may be implemented as hardware and/or software, according to various embodiments. The storage system300may include a storage system manager312for communicating with a plurality of media and/or drives on at least one higher storage tier302and at least one lower storage tier306. The higher storage tier(s)302preferably may include one or more random access and/or direct access media304, such as hard disks in hard disk drives (HDDs), nonvolatile memory (NVM), solid state memory in solid state drives (SSDs), flash memory, SSD arrays, flash memory arrays, etc., and/or others noted herein or known in the art. The lower storage tier(s)306may preferably include one or more lower performing storage media308, including sequential access media such as magnetic tape in tape drives and/or optical media, slower accessing HDDs, slower accessing SSDs, etc., and/or others noted herein or known in the art. One or more additional storage tiers316may include any combination of storage memory media as desired by a designer of the system300. Also, any of the higher storage tiers302and/or the lower storage tiers306may include some combination of storage devices and/or storage media.

The storage system manager312may communicate with the drives and/or storage media304,308on the higher storage tier(s)302and lower storage tier(s)306through a network310, such as a storage area network (SAN), as shown inFIG.3, or some other suitable network type. The storage system manager312may also communicate with one or more host systems (not shown) through a host interface314, which may or may not be a part of the storage system manager312. The storage system manager312and/or any other component of the storage system300may be implemented in hardware and/or software, and may make use of a processor (not shown) for executing commands of a type known in the art, such as a central processing unit (CPU), a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), etc. Of course, any arrangement of a storage system may be used, as will be apparent to those of skill in the art upon reading the present description.

According to some embodiments, the storage system (such as300) may include logic configured to receive a request to open a data set, logic configured to determine if the requested data set is stored to a lower storage tier306of a tiered data storage system300in multiple associated portions, logic configured to move each associated portion of the requested data set to a higher storage tier302of the tiered data storage system300, and logic configured to assemble the requested data set on the higher storage tier302of the tiered data storage system300from the associated portions.

As previously mentioned, conventional systems have experienced a significant consumption of available computing bandwidth and I/O throughput when performing data sorting operations. While data sorting allows for data to generally be better understood, actually performing the sorting can be a resource intensive process. For instance, operations like data sorting include performing sets of processes in a serial nature, thereby lengthening the time elapsed while attempting to satisfy the processes.

This is particularly apparent in situations where higher performance storage is utilized to perform at least a portion of the data sorting. While higher performance storage (e.g., such as local cache) provides more desirable performance metrics compared to lower performance storage (e.g., such as external disk), these higher performance metrics are typically paired with lower storage capacity in view of the higher cost associated with the higher performance storage, at least in comparison to the lower performance storage. Accordingly, performance of such conventional systems has significantly been impacted by record processing operations such as data sorting.

In sharp contrast to these conventional shortcomings, various ones of the approaches included herein are able to significantly reduce performance times while satisfying data processing operations. For operations such as data sorting, this reduction in achievable performance times is achieved, at least in part, as a result of performing different portions of the operations in parallel. This effectively increases throughput of the system and reduces the consumption of computing bandwidth, e.g., as will be described in further detail below.

Referring now toFIG.4A, a flowchart of a method400for reducing computational resource consumption while performing data processes, is shown according to one embodiment. The method400may be performed in accordance with the present invention in any of the environments depicted inFIGS.1-3, among others, in various embodiments. Of course, more or less operations than those specifically described inFIG.4Amay be included in method400, as would be understood by one of skill in the art upon reading the present descriptions.

Each of the steps of the method400may be performed by any suitable component of the operating environment. For example, one or more of the operations included in method400may be performed by a central processor that has access to an input buffer. In other embodiments, the method400may be partially or entirely performed by a controller, a processor, a computer, etc., or some other device having one or more processors therein. Thus, in some embodiments, method400may be a computer-implemented method. In such embodiments, the computer used to implement the method may include the tape drive itself or a portion thereof such as the controller, the tape, an external host, a server, etc. Moreover, the terms computer, processor and controller may be used interchangeably with regards to any of the embodiments herein, such components being considered equivalents in the many various permutations of the present invention.

As shown inFIG.4A, operation402of method400includes receiving a data process. Depending on the approach, the type of data process received in operation402may vary. For instance, in some approaches a data sort process may be received in operation402, while in other approaches the data process may be a data write process, a deletion process, etc. It should also be noted that the data process may be received in different forms. For example, in some approaches a request to perform a specific data process may be received in operation402, while in other approaches one or more instructions to perform a data process may be received. The data process itself may also be received from different sources. In different approaches, the data process may be received from a user, a running application, another computing environment, a remote storage location, etc.

While the data process received in operation402may vary depending on the given approach as described above, it should be noted that it typically includes a plurality of sub-processes. In other words, although the processes that are received may be of different types, be received from different sources and/or in different forms, etc., each of the processes may still include a number of sub-processes, e.g., as would be appreciated by one skilled in the art after reading the present description. According to an example, which is in no way intended to limit the invention, a data sort process includes I/O sub-processes, sorting sub-processes, and supplemental (e.g., additional) sub-processes which together represent the overall data sort process. Each type of sub-processes may further be assigned to a specific one or more of the threads that exist in a central processor, e.g., as will be described in further detail below.

As noted above, one or more of the operations included in method400may be performed by a central processor that has access to an input buffer or queue. Thus, data processes received in operation402may be stored in an input buffer or even received from the input buffer itself in some approaches. Entries in the input buffer may be processed in any desired order depending on the approach, e.g., such as first-in-first-out (FIFO), last-in-first-out (LIFO), according to a level of importance, etc.

With respect to the present description, a “process” can be considered an address space or a job which includes multiple different sub-processes therein as previously mentioned. Moreover, a number of threads are used to actually run and perform the work or sub-processes. In other words, a process represents a group of units of work (e.g., sub-processes) which can be satisfied using different threads. It follows that a “thread” essentially performs (e.g., dispatches) units of work on a processor. A thread can also be run using a service request block (SRB) which itself may operate on a processor. Approaches in which threads are run using a SRB may serve as a light-weight option for running the threads, e.g., as would be appreciated by one skilled in the art after reading the present description. Moreover, in such approaches the processor may search SRB queues and/or task queues for threads to run.

The central processor is also preferably able to implement multi-threaded functionality such that more than one of the data sub-processes can be performed by the threads in parallel. With respect to the present description, “multi-threaded” is intended to refer to a situation where multiple sub-processes or multiple units of work can be performed simultaneously and in parallel to accomplish the overarching data process. In other words, the processor used to perform at least some of the operations in method400may be able to perform more than one sub-process by running more than one thread at a time, thereby achieving simultaneous multi-threading (SMT). SMT increases efficiency by allowing the processor to increase throughput by increasing the amount of work that is performed in parallel, as well as continuing to work towards satisfying the received data process even when one of the multiple running threads experiences a stall event.

According to an example, which is in no way intended to limit the invention, if a thread is stalled and waiting for a condition to be satisfied (e.g., a step to be performed), it is more efficient for the processor to grab another thread (e.g., another piece of work) and run that thread until it too stalls, whereby the processor can attempt to switch back to a previously stalled thread. Moreover, the processor may be running more than one thread in parallel at a given time, thereby further increasing throughput and efficiency of the system.

As noted above, the processor is desirably able to achieve SMT by running more than one thread at a time. Each thread may also be assigned a different set of sub-processes to be performed as a part of satisfying the originally received data process. Accordingly, referring back toFIG.4A, method400includes assigning a unique subset of the sub-processes in the received data process to each of the threads being run by the processor. See operation404. Thus, operation404includes assigning a unique subset of the sub-processes to each of: a managing thread, and at least one other thread (e.g., a sorting thread) such that each thread then has a different subset assigned thereto, e.g., as will be described in further detail below.

Although the processes that are received may be of different types, be received from different sources and/or in different forms, etc., each of the processes may still include a number of sub-processes, e.g., as would be appreciated by one skilled in the art after reading the present description. According to an example, which is in no way intended to limit the invention, a data sort process includes I/O sub-processes, sorting sub-processes, and supplemental (e.g., additional) sub-processes. Each type of sub-processes may further be assigned to a specific one or more of the threads that exist in a central processor. In other words, while the number of threads actively being run by the processor may vary depending on the situation, certain threads may correspond to predetermined types of sub-processes.

For instance, I/O related sub-processes may be assigned to one of the threads that serves as the managing thread, while sorting related sub-processes are assigned to a sort thread. With respect to the present description, the “managing thread” may represent the unit of work that the system was initially called on, while subsequent threads (e.g., such as a sort thread) are created and become offspring of the original managing thread. In other words, the managing thread is the monitoring and controlling thread that not only performs a subset of the sub-processes associated with a given data process, but also manages the other threads that are being used to perform the remainder of the sub-processes associated with the given data process in parallel with those that have been assigned to the managing thread. Thus, when a subsequent thread is created, the managing thread shifts one or more responsibilities to the subsequent thread, and informs the subsequent thread to pursue the shifted responsibilities.

Referring again to an example, which is in no way intended to limit the invention, a data sort process may initially be received in operation402of method400. A data sort process typically includes I/O related sub-processes, sorting related sub-processes, and various supplemental (e.g., additional) sub-processes. It follows that each of these types of sub-processes may be assigned to a different one of the threads that are running in the processor.

For instance, referring momentarily now toFIG.4B, exemplary sub-operations of assigning a unique subset of the sub-processes associated with a data sort process to each of the threads are illustrated in accordance with an in-use embodiment, one or more of which may be used to perform operation404ofFIG.4A. However, it should be noted that the sub-operations ofFIG.4Bare illustrated in accordance with one in-use embodiment which is in no way intended to limit the invention. For instance, at least some of the sub-operations ofFIG.4Bmay be implemented in order to satisfy different types of data processes.

As shown, sub-operation450includes identifying the various sub-processes that are associated with the data sort process currently being evaluated. This may be achieved by actually inspecting the received data sort process, identifying the sub-processes from a lookup table based on the type of process that was received, adopting a default set of sub-processes associated with the received data sort process, etc. In some approaches, a data sort process includes I/O sub-processes, sorting sub-processes, and supplemental sub-processes.

The identified sub-processes are preferably evaluated and compared to the number and types of threads that currently exist in the processor. This allows for the different types of the sub-processes to be assigned to the corresponding types of threads, as well as ensuring that each thread is assigned about the same amount of work. While certain types of sub-processes are assigned to specific ones of the threads in some approaches, it should also be noted that the number of sub-processes assigned to each of the threads is taken into consideration. As mentioned above, it is preferred that the threads satisfy the sub-processes they are assigned in about the same amount of time, and therefore that the threads experience about the same amount of latency.

While the sub-processes may be assigned to the different threads in a manner that facilitates the sub-processes being completed at about the same time, conditions may change during actual performance of the sub-processes. Accordingly, the multi-threaded sort functionality will also dynamically monitor the progression of the threads and adjust which sub-processes are assigned to which of the threads based on the changing capacities of the threads. Again, the desired outcome is that each of the threads complete the sub-processes assigned thereto with substantially the same amount of blocked (e.g., wait) time experienced.

With continued reference toFIG.4B, sub-operation452includes assigning the I/O sub-processes of the received data sort process to the managing thread, while sub-operation454includes assigning the sorting sub-processes of the received data sort process to a sort thread. As noted above, the managing thread may represent the unit of work that the system was initially called on, while subsequent threads (e.g., such as the sort thread) are created and become offspring of the original managing thread. In other words, the managing thread is the monitoring and controlling thread that not only performs a subset of the sub-processes associated with the data sort process in the present in-use embodiment ofFIG.4B, but also manages the other threads that are being used to perform the remainder of the sub-processes associated with the given data sort process in parallel with those that have been assigned to the managing thread. It follows that when a subsequent thread is created, the managing thread shifts one or more responsibilities to the subsequent thread, and informs the subsequent thread to pursue the shifted responsibilities.

While any desired number of threads may be running depending on the particular approach, in the present in-use embodiment, only the managing thread and the sorting thread are currently running. Accordingly, sub-operation456includes dividing the remaining supplemental sub-processes into a first portion and a second portion. The first and second portions are ultimately assigned to the managing thread and the sorting thread (e.g., see sub-operations458,460below), so it is desirable that the size of the portions is determined such that the respective threads are able to perform the corresponding sub-processes in about the same amount of time. It follows that performing sub-operation456may be based on past performance of the threads, user preferences, predetermined system settings, anticipated throughputs of the system and/or the threads themselves, industry standards, etc.

From sub-operation456, the flowchart proceeds to sub-operation458which includes assigning the first portion of the remaining supplemental sub-processes to the managing thread. Furthermore, sub-operation460includes assigning the second portion of the remaining supplemental sub-processes to the sort thread. In some approaches, a sub-process may be assigned to a given thread by adding the sub-process to a queue specifically assigned to the given thread, updating one or more flags, modifying a lookup table, creating a pointer that connects the sub-process to the given thread, etc., or any other steps that would be apparent to one skilled in the art after reading the present description.

Returning now toFIG.4A, once the various sub-processes have been assigned to one of the threads, method400proceeds to operation406. There, operation406includes causing each of the subsets of sub-processes to be performed by the thread to which the respective subset is assigned. In other words, operation406includes causing the different subsets of sub-processes to be performed by each of the respective threads.

As noted above, a thread essentially performs (e.g., dispatches) units of work on a processor. It follows that in some approaches, operation406may be performed by instructing the various threads to dispatch the units of work associated with the various sub-processes assigned thereto. Moreover, these units of work may be dispatched to a central processor, a SRB acting as a processor, or some other type of computing device capable of performing at least a portion of the sub-processes. It is also preferred that the different subsets of sub-processes are performed by each of the respective threads simultaneously and in parallel. This desirably increases throughput of the system, reduces latency, improves efficiency, and reduces the computational resources consumed in order to satisfy the originally received data process.

While the various sub-processes are being performed by each of the respective threads, performance of the threads is continually monitored. Again, it is desirable that the threads are able to perform the corresponding sub-processes in about the same amount of time. Thus, as the threads continue to work on the sub-processes that are assigned thereto, the managing thread preferably monitors performance characteristics of the threads in order to determine whether adjustments to the assignment of sub-processes should be made. For example, if a particular thread has experienced a high number of delays, the managing thread may determine that some of the sub-processes currently assigned to the delayed thread be reassigned to one or more of the other threads having a lower number of delays.

Accordingly, operation408includes evaluating performance characteristics of each of the threads while the respective subsets of sub-processes are being performed, while decision410includes determining whether the performance characteristics of each of the threads are substantially equal to the performance characteristics of each of the other threads. In other words, decision410includes determining whether the performance characteristics of each of the threads are equal to each other. Different performance characteristics may be used to satisfy operation408and decision410depending on the particular approach. For instance, in some approaches the wait time experienced by each of the threads may be used as the performance characteristic that determines whether the threads are operating substantially equal. However, in other approaches a number of data failures experienced, the introduction and/or removal of any threads, etc., may be evaluated to determine whether the sub-processes should be reassigned to the threads.

Referring momentarily now toFIG.4C, exemplary sub-operations of evaluating performance characteristics of the threads and determining whether the performance characteristics of the threads are substantially equal are illustrated in accordance with an in-use embodiment. One or more of the sub-operations depicted inFIG.4Cmay be used to perform operation408and/or decision410ofFIG.4A. However, it should be noted that the sub-operations ofFIG.4Care illustrated in accordance with one in-use embodiment which is in no way intended to limit the invention. It should also be noted that the sub-operations depicted inFIG.4Care preferably performed for each of the active threads.

As shown, sub-operation470includes determining a current and/or accumulated wait time experienced by the thread since being assigned the respective subset of sub-processes. With respect to the present description, a “wait time” is the amount of time the thread has been inactive or idle while waiting for other sub-processes to be performed by the other threads. Thus, the accumulated wait time of a given thread represents the amount of latency that thread has contributed to the performance of the overarching process. The wait time for a given thread may be initiated (e.g., started) when the thread is actually assigned a subset of sub-processes and may be reset (e.g., ended) when the assigned subset of sub-processes have been completed. However, in other approaches the wait time for a given thread may be accumulated over the life of the thread, be reset in response to receiving an input from a user, be initiated and/or reset in response to a predetermined condition (e.g., experiencing a failure event), etc., or any other desired scheme. This wait time of a thread can also be compared to wait times experienced by the remaining threads since being assigned their respective subsets of sub-processes. See sub-operation472. This allows for the system to determine whether only the given thread has experienced an unexpected wait time, or if similar levels of latency have been experienced by the remaining threads.

Proceeding to decision474, a determination is made as to whether a difference between the wait time experienced by the given thread and the wait times experienced by the remaining threads is outside a predetermined range. Decision474thereby essentially determines whether the given thread has experienced a disproportional amount of delay in performing the sub-processes that have been assigned thereto. This can be accomplished by comparing the wait time of the given thread to the wait times experienced by each of the other threads individually, comparing it to an average wait time experienced by the other threads, comparing it to the wait times experienced by select ones of the other threads, etc. It should also be noted that “outside a predetermined range” is in no way intended to limit the invention. Rather than determining whether a value is outside a predetermined range, equivalent determinations may be made, e.g., as to whether a value is within a predetermined range, whether a value is above a threshold, whether an absolute value is above a threshold, whether a value is below a threshold, etc., depending on the desired approach. Moreover, the range may be predetermined by a user, based on industry standards, using anticipated throughputs of the threads, based on past performance, the type of data process being performed, etc.

From decision474, the flowchart proceeds to operation476in response to determining the difference between the wait time experienced by the thread and the wait times experienced by the remaining threads is outside the predetermined range. There, operation476includes determining that the performance characteristics of the threads are not substantially equal before proceeding directly to operation412ofFIG.4A, e.g., as will be described in further detail below. However, in response to determining that the difference between the wait time experienced by the thread and the wait times experienced by the remaining threads is not outside the predetermined range, the flowchart jumps from decision474directly to operation412ofFIG.4A.

Returning now toFIG.4A, method400proceeds from decision410to operation412in response to determining that the performance characteristics of the threads are not substantially equal. There, operation412includes dynamically adjusting the different subsets of the sub-processes in an attempt to normalize the performance characteristics of the different threads. In other words, operation412includes adjusting the number of sub-processes that are assigned to each of the threads in order to more evenly distribute the amount of wait time that is being experienced by the threads and such that the performance characteristics of each of the threads become more equal. This allows for the system to actively adjust the amount of wait time that is experienced by each of the threads and thereby ensure that the overarching data process is performed more efficiently than if the sub-processes were statically assigned to each of the threads. It should also be noted that method400jumps from decision410directly to decision416in response to determining that the performance characteristics of the threads are substantially equal, e.g., as will be described in further detail below.

Once the number of sub-processes that are assigned to each of the threads has been adjusted, method400further includes actually reassigning the adjusted subsets of the sub-processes to each of the managing thread and at least one other thread. See operation414. The adjusted subsets may be reassigned to the various threads by sending one or more instructions to the respective threads, updating a lookup table (e.g., a logical-to-physical table), adjusting one or more flags, etc.

From operation414, method400proceeds to decision416which includes determining whether the data process received in operation402has been satisfied. In other words, decision416includes determining whether the sub-processes assigned to the various threads have been satisfied. As shown, the flowchart returns to decision410in response to determining that the data process received in operation402has not yet been satisfied, e.g., such that decision410may be repeated in order to determine whether the performance characteristics of the threads are still substantially equal. However, in response to determining that the data process received in operation402has been satisfied, the flowchart proceeds from decision416to operation418, whereby method400may end. However, it should be noted that although method400may end upon reaching operation418, any one or more of the processes included in method400may be repeated in order to satisfy additional data processes. In other words, any one or more of the processes included in method400may be repeated for subsequently received data processes.

As noted above, the flowchart also jumps to decision416from decision410in response to determining that the performance characteristics of the threads are substantially equal. It follows that in response to determining that the performance characteristics of the threads are substantially equal, the assignment of the different subsets of sub-processes to each of the threads is maintained before determining whether the data process itself has been satisfied yet.

It follows that various ones of the operations included inFIGS.4A-4Care able to gain efficiency by overlapping I/O processing as much as possible, particularly for CPU intensive data processes such as key comparisons and data movements. As described above, this increased throughput is achieved by establishing and managing multiple different threads, each of which can be used to satisfy different portions of a data process. Multiple I/O buffers can be used so processing can run in parallel in addition to dynamically monitoring processing during performance. As a result, the multi-threaded sort functionality described herein is able to dynamically monitor progress and adjust where processing will occur based on which threads have more capacity, with the goal that the threads satisfy all assigned sub-processes with having experienced substantially the same amount of wait time.

According to an in-use example, which is in no way intended to limit the invention, a data sort operation may be received at a processor having a managing thread and a sort thread. The I/O related sub-processes in the data sort operation may thereby be performed by the managing thread, while data sorting related sub-processes may be assigned to the sort thread specifically. It follows that for the input phase of the sort processing, the managing (e.g., I/O) thread may obtain the input data (e.g., either from external media or from some programmatic process), and provide full buffers to the sort thread which could then sort the data. For instance, data may be gathered from different sources depending on the approach. These sources may include memory (e.g., disk, magnetic tape, etc.), a socket over a network, an application, etc. The managing thread may also minimize blocking itself from I/Os by utilizing multiple buffers.

The sort thread also performs key comparisons to determine whether the system is performing efficiently. These comparisons can be interrupted in certain situations though, such as when in an input phase and there is no current input buffer to process or when in an output phase and all output buffers are full. The comparisons may also be interrupted in situations where memory has become or was constrained, and the I/O task was involved with processing spill data to and/or from disk.

With continued reference to the present in-use example, it follows that the main division of labor is that I/Os are being performed by the managing thread, while sorting is performed by the sort thread. Additional sub-processes that are associated with performing the overarching data process can occur in either thread. Some of these sub-processes that can be performed by either thread include, but are in no way limited to data summation, report processing, spill processing, record editing (e.g., when data is being transformed, expanded, truncated, etc. to meet user preferences), record restoration (e.g., rebuilding data that had to be spilled to disk in memory constrained situations), etc.

For instance, in some approaches any available thread may be used to perform key extraction. Sorting keys are typically normalized as they can be in many different formats, e.g., such as ascending vs. descending, zoned decimal format, packed decimal format, multi-byte character set consideration, etc. In some situations, key extraction involves separating the non-key data from the key data. However, in other approaches any available thread may be used to perform sequence detection processing in which an already ascending or descending sequence detection can help determine where the next input record should be placed.

It follows that the managing thread (e.g., the I/O thread may be considered the managing thread) will determine the responsibility of each thread at the start of processing, and the assignment of these responsibilities is made available to each thread. Each thread will keep track of the amount of time it has spent waiting on the remaining thread(s) as the managing thread can detect significant deviations in wait times experienced by the threads and reassign the responsibilities thereof dynamically. For instance, assuming that a managing thread and a sort thread are used for a given sort process, the managing thread may build channel programs to read data, fill the buffers, and then provide the filled buffers to the sort thread. The sort thread may thereby perform the sorting process (e.g., key extraction, actual sorting, etc.) and once all input data has been read, the sort thread may begin to queue data to the managing thread for final output processing.

The managing thread may restore the records into their original form (e.g., by unnormalizing the key data into the original record format), place the data into the output buffers, build the channel programs, and write the data to the output dataset. However, if the managing thread determines that the sort thread is waiting more than the managing thread is, the responsibility of restoring the records into their original form and placing those records into the output buffer could be moved to the sort thread, thereby providing better balance in processing and increasing the achievable throughput of the system.

Each thread is also preferably able to keep track of how much effort is spent performing each of these responsibilities. For instance, an ideal performance of key extraction can be evaluated (e.g., timed) to gain a better understanding of how much processing power and/or time should be spent performing the various sub-processes. This monitoring will help the monitoring thread determine which responsibilities could be shifted to create the most balanced workload and thereby maximize efficiency.

Again, various ones of the approaches included herein are desirably able to survey what computing resources are available and assign the various sub-processes to be completed to the available threads. If the sub-processes are being performed as desired, the approaches herein may not perform any reassignments of the work. However, the different threads preferably perform the sub-processes in about the same amount of time, and therefore the managing thread may balance the different units of work (sub-processes) associated with the received process and distribute them to an available thread. Moreover, dynamic adjustments may be made to the work assignments, e.g., based on actual performance of the system, until the originally received process is satisfied.