System and method for improving run-time performance of applications with multithreaded and single threaded routines
First Claim
1. A method for running a mixed single-threaded/multi-threaded (ST/MT) application program linked with a libpthreads library, the method comprising:
- creating an interceptor library containing pthread application programming interface (pthread_API) call interceptors and loading the interceptor library into the mixed ST/MT application program;
incrementing or decrementing a thread counter upon each pthread_create call or pthread_exit call, respectively, during run-time;
triggering a helper thread upon decrementing the thread counter by a predetermined value, wherein the helper thread computes an estimated resulting overhead by determining a duration of time the mixed ST/MT application program runs in an ST program mode by examining sliced versions of the mixed ST/MT application program; and
running the mixed ST/MT application program on a computer by using light weight (LW) and heavy weight (HW) synchronization routines based on determining switchovers between the ST program mode and an MT program mode, respectively, during run-time using the interceptor library, the mixed ST/MT application program being run in the ST program mode by informing a pthreads library to call the LW synchronization routines or in the MT program mode by informing the pthreads library to call the HW synchronization routines based on the determined duration of time and the estimated resulting overhead, selection between the ST program mode and the MT program mode being based on a value in the thread counter.
4 Assignments
0 Petitions
Accused Products
Abstract
A system and method for improving run-time performance of applications with multithreaded and single threaded routines that are linked with libpthreads library is disclosed. In one embodiment, a method for running a mixed ST/MT application program linked with libpthreads library including creating an interceptor library containing pthread application programming interface (pthread_API) call interceptors and loading the interceptor library into the mixed ST/MT application program, and running the mixed ST/MT application program by using light weight (LW) and heavy weight (HW) synchronization routines based on determining switchovers between ST and MT program modes, respectively, during run-time using the interceptor library.
-
Citations
14 Claims
-
1. A method for running a mixed single-threaded/multi-threaded (ST/MT) application program linked with a libpthreads library, the method comprising:
-
creating an interceptor library containing pthread application programming interface (pthread_API) call interceptors and loading the interceptor library into the mixed ST/MT application program; incrementing or decrementing a thread counter upon each pthread_create call or pthread_exit call, respectively, during run-time; triggering a helper thread upon decrementing the thread counter by a predetermined value, wherein the helper thread computes an estimated resulting overhead by determining a duration of time the mixed ST/MT application program runs in an ST program mode by examining sliced versions of the mixed ST/MT application program; and running the mixed ST/MT application program on a computer by using light weight (LW) and heavy weight (HW) synchronization routines based on determining switchovers between the ST program mode and an MT program mode, respectively, during run-time using the interceptor library, the mixed ST/MT application program being run in the ST program mode by informing a pthreads library to call the LW synchronization routines or in the MT program mode by informing the pthreads library to call the HW synchronization routines based on the determined duration of time and the estimated resulting overhead, selection between the ST program mode and the MT program mode being based on a value in the thread counter. - View Dependent Claims (2, 3, 4)
-
-
5. A method for running a mixed single-threaded/multi-threaded (ST/MT) application program linked with a libpthreads library, the method comprising:
-
creating an interceptor library containing pthread application programming interface (pthread_API) call interceptors and loading the interceptor library into the mixed ST/MT application program; and running the mixed ST/MT application program on a computer by using light weight (LW) and heavy weight (HW) synchronization routines based on determining switchovers between ST and MT program modes, respectively, during run-time using the interceptor library, running the mixed ST/MT application program by using the LW and HW synchronization routines based on determining the switchovers between the ST and MT program modes comprising; dynamically loading the interceptor library before loading other shared libraries into the mixed ST/MT application program; and initializing a thread counter by a predetermined value; incrementing or decrementing the thread counter by the predetermined value upon each pthread_create call or pthread_exit call, respectively, during run-time; and running the mixed ST/MT application program in the ST program mode by informing a pthreads library to call the LW synchronization routines or in the MT program mode by informing the pthreads library to call the HW synchronization routines based on a value in the thread counter; and running the mixed ST/MT application program comprising; triggering a helper thread upon decrementing the thread counter by the predetermined value, wherein the helper thread computes an estimated resulting overhead by determining a duration of time the mixed ST/MT application program runs in the ST program mode by examining sliced versions of the mixed ST/MT application program; and running the mixed ST/MT application program in the ST program mode by informing the pthreads library to call the LW synchronization routines or in the MT program mode by informing the pthreads library to call the HW synchronization routines based on the determined duration of time and the estimated resulting overhead, the resulting overhead and an expected percent of improvement being computed using the equations;
resulting overhead=number of locks to be converted*estimated overhead+helper thread overhead+pthread call overhead; and
expected percent of improvement=number of locks found during the period of time the mixed ST/MT application program runs in the ST program mode*estimated overhead for HW per lock.
-
-
6. A method for running a mixed single-threaded/multi-threaded (ST/MT) application program linked with a libpthreads library, the method comprising:
-
creating the libpthreads library including an interceptor library containing (API) call interceptors and loading the libpthreads library into the mixed ST/MT application program; incrementing or decrementing a thread counter upon each pthread_create call or pthread_exit call, respectively, during run-time; triggering a helper thread upon decrementing the thread counter by a predetermined value, wherein the helper thread computes an estimated resulting overhead by determining a duration of time the mixed ST/MT application program runs in an ST program mode by examining sliced versions of the mixed ST/MT application program; and running the mixed ST/MT application program on a computer by using LW and HW synchronization routines based on determining switchovers between the ST program mode and an MT program mode, respectively, during run-time using the interceptor library, the mixed ST/MT application program being run in the ST program mode by informing a pthreads library to call the LW synchronization routines, or in the MT program mode by informing the pthreads library to call the HW synchronization routines based on the determined duration of time and the estimated resulting overhead, selection between the ST program mode and the MT program mode being based on a value in the thread counter. - View Dependent Claims (7, 8)
-
-
9. A computer readable storage medium comprising instructions which, when executed by a computer, cause the computer to run a mixed ST/MT program linked with libpthreads library, the instructions comprising:
-
creating an interceptor library containing pthread application programming interface (pthread_API) call interceptors and loading the interceptor library into the mixed ST/MT application program; incrementing or decrementing a thread counter upon each pthread_create call or pthread_exit call, respectively, during run-time; triggering a helper thread upon decrementing the thread counter by a predetermined value, wherein the helper thread computes an estimated resulting overhead by determining a duration of time the mixed ST/MT application program runs in an ST program mode by examining sliced versions of the mixed ST/MT application program; and running the mixed ST/MT application program by using LW and HW synchronization routines based on determining switchovers between the ST program mode and an MT program mode, respectively, during run-time using the interceptor library, the mixed ST/MT application program being run in the ST program mode by informing a pthreads library to call the LW synchronization routines or in the MT program mode by informing the pthreads library to call the HW synchronization routines based on the determined duration of time and the estimated resulting overhead, selection between the ST program mode and the MT program mode being based on a value in the thread counter. - View Dependent Claims (10, 11)
-
-
12. A computer system comprising:
-
a processor; and a memory in communication with the processor, the memory to store instructions which, when executed by the processor, cause the processor to perform a method of running a mixed ST/MT application program linked with a libpthreads library, the method comprising; creating an interceptor library containing pthread application programming interface (pthread_API) call interceptors and loading the interceptor library into the mixed ST/MT application program; incrementing or decrementing a thread counter upon each pthread_create call or pthread_exit call, respectively, during run-time; triggering a helper thread upon decrementing the thread counter by a predetermined value, wherein the helper thread computes an estimated resulting overhead by determining a duration of time the mixed ST/MT application program runs in an ST program mode by examining sliced versions of the mixed ST/MT application program; and running the mixed ST/MT application program by using LW and HW synchronization routines based on determining switchovers between the ST program mode and an MT program mode, respectively, during run-time using the interceptor library, the mixed ST/MT application program being run in the ST program mode by informing a pthreads library to call the LW synchronization routines or in the MT program mode by informing the pthreads library to call the HW synchronization routines based on the determined duration of time and the estimated resulting overhead, selection between the ST program mode and the MT program mode being based on a value in the thread counter. - View Dependent Claims (13, 14)
-
Specification