IP Library Granted Patent US 8,495,662
Granted Patent B2
US 8,495,662 · App. 12/235,625 · Granted Jul 23, 2013

System and method for improving run-time performance of applications with multithreaded and single threaded routines

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,495,662
App. No.
12/235,625
Granted
Jul 23, 2013
Kind
B2
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.

Claims (59)

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.

2. The method of claim 1 , wherein 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 comprises:

dynamically loading the interceptor library before loading other shared libraries into the mixed ST/MT application program; and

initializing the thread counter.

3. The method of claim 1 , wherein running the mixed ST/MT application program comprises:

estimating a second resulting overhead due to the switchovers between the ST and MT program modes using statistical analysis or profile data including pthread API calls based on previous mixed ST/MT application program runs upon incrementing the thread counter by the predetermined value; 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 estimated second resulting overhead.

4. The method of claim 3 , wherein the statistical analysis or profile data including the pthread API calls is based on the duration of time during which the mixed ST/MT application program stays in the ST program mode during run-time and the estimated second resulting overhead.

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.

7. The method of claim 6 , wherein 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 comprises:

loading the libpthreads library into the mixed ST/MT application program; and

initializing the thread counter.

8. The method of claim 6 , wherein running the mixed ST/MT application program comprises:

estimating a second resulting overhead due to the switchovers between the ST and MT program modes using statistical analysis or profile data including pthread API calls based on previous mixed ST/MT application program runs upon incrementing the thread counter by the predetermined value; 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 estimated second resulting overhead due to the switchovers between the ST and MT program modes.

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.

10. The storage medium of claim 9 , wherein 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 comprises:

dynamically loading the interceptor library before loading other shared libraries into the mixed ST/MT application program; and

initializing the thread counter.

11. The article storage medium of claim 9 , wherein running the mixed ST/MT application program comprises:

estimating a second resulting overhead due to the switchovers between the ST and MT program modes using statistical analysis or profile data including pthread API calls based on previous mixed ST/MT application program runs upon incrementing the thread counter by the predetermined value; 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 estimated second resulting overhead.

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.

13. The system of claim 12 , wherein 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 comprises:

dynamically loading the interceptor library before loading other shared libraries into the mixed ST/MT application program; and

initializing the thread counter.

14. The system of claim 12 , wherein running the mixed ST/MT application program comprises:

estimating a second resulting overhead due to the switchovers between the ST and MT program modes using statistical analysis or profile data including pthread API calls based on previous mixed ST/MT application program runs upon incrementing the thread counter by the predetermined value; and

running the mixed ST/MT application program in the ST program mode by informing 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 estimated second resulting overhead.

Assignments (4)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 26, 2021
From: OT PATENT ESCROW, LLC
To: VALTRUS INNOVATIONS LIMITED
Reel/Frame 057650/0537 →
PATENT ASSIGNMENT, SECURITY INTEREST, AND LIEN AGREEMENT Recorded Jan 26, 2021
From: HEWLETT PACKARD ENTERPRISE DEVELOPMENT LP; HEWLETT PACKARD ENTERPRISE COMPANY
To: OT PATENT ESCROW, LLC
Reel/Frame 055269/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 9, 2015
From: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
To: HEWLETT PACKARD ENTERPRISE DEVELOPMENT LP
Reel/Frame 037079/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 23, 2008
From: MANNARSWAMY, SANDYA SRIVILLIPUTTUR; SARASWATI, SUJOY; RAGHAVENDRA, PRAKASH SATHYANATH
To: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
Reel/Frame 021571/0046 →