← Back to Patent Explorer
US5481706A Expired / Lapsed US ⏱️ 0.0 years remaining

System and method for creating thread-safe shared libraries

Assignee: International Business Machines Corp
•
Filing: 1993-11-01
•
Granted: 1996-01-02
•
Expires: 2013-11-01
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract Libraries for use in a multithreaded computer environment which must be thread-safe and cannot be recoded are identified. Such libraries, after identification, are repackaged. Export routines for such libraries will thereby acquire a front end which effects several steps. First a write-exclusive lock for a particular called function of one of the libraries is generically acquired. A call is then made to the underlying function whose name has been remapped. Upon return from the real routine, the write-exclusive lock is unlocked and a return to the user is executed. The system and method ensure correct functioning and integrity of the identified library functions accessible by multiple threads, as well as providing for creation of multithread-safe shared libraries without necessitating extensive library source modifications.

Inventors

  • 👤 Jeffrey S. Peek

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-11-02 02:49
CPC Classifications
G; G06; G06F; G06F9/00; G06F9/06; G06F9/46; G06F9/52

Claims Analysis

Total Claims: 9
Claim 1
Independent Claim 187 words
A method for use in a multithread computer system employing a pre-existing shared library having a pre-existing function descriptor, a pointer to said function descriptor and a corresponding at least one function which is not multithread-safe when used in said system having a corresponding underlying call associated therewith exported from said library to render said shared library multithread-safe when used in said system, comprising: creating a wrapper for said function comprised of program code extending around instantiation of said underlying call said wrapper being responsive to a call corresponding to said underlying call, said creating including the steps of storing said pre-existing function descriptor therewithin, and creating a lock to said function; and rebinding said pre-existing shared library with said wrapper including the steps of creating a modified function descriptor including creating a pointer to said wrapper and creating a copy of said function descriptor with said pointer to said wrapper in said modified function descriptor being substituted for said pointer to said function in said function descriptor during said rebinding; and substituting a pointer to said modified pointer descriptor for said pointer to said function descriptor.
Claim 2
Independent Claim 187 words
A method for use in a multithread computer system employing a pre-existing shared library having a pre-existing function descriptor, a pointer to said function descriptor and a corresponding at least one function which is not multithread-safe when used in said system having a corresponding underlying call associated therewith exported from said library to render said shared library multithread-safe when used in said system, comprising: creating a wrapper for said function comprised of program code extending around instantiation of said underlying call said wrapper being responsive to a call corresponding to said underlying call, said creating including the steps of storing said pre-existing function descriptor therewithin, and creating a lock to said function; and rebinding said pre-existing shared library with said wrapper including the steps of creating a modified function descriptor including creating a pointer to said wrapper and creating a copy of said function descriptor with said pointer to said wrapper in said modified function descriptor being substituted for said pointer to said function in said function descriptor during said rebinding; and substituting a pointer to said modified pointer descriptor for said pointer to said function descriptor.
Claim 3
Dependent Claim 30 words
The method of claim 1 wherein calling said function before and after said rebinding invokes said pointer to said function descriptor and said pointer to said modified function descriptor, respectively.
Claim 4
Dependent Claim 19 words
The method of claim 2 wherein said function descriptor includes a pointer to a routine corresponding to said function.
Claim 5
Independent Claim 230 words
A method for modifying a multithread shared library computer system in which an underlying function call exported from said shared library invokes a pointer to a function descriptor which, in turn, invokes a pointer to a corresponding routine of said shared library thereby causing execution of said routine, whereby multithread safe use of said shared library is facilitated said method comprising: providing a wrapper including a lock being comprised of program code extending around instantiation of said underlying function call, said wrapper being responsive to a call corresponding to said underlying call and including a lock for said routine, said wrapper further including said function descriptor; providing a substitute function descriptor with a pointer to said wrapper; changing said pointer to said function descriptor into a pointer to said substitute function descriptor; invoking said pointer to said substitute function descriptor; invoking with said pointer to said substitute function descriptor said pointer to said wrapper; and invoking with said pointer to said wrapper execution of said wrapper including executing said routine from said function call sequentially through said substitute function descriptor and then through said wrapper including said function descriptor; executing a lock on said routine; invoking said pointer of said function descriptor in said wrapper to said routine thereby causing its execution; and unlocking said lock on said routine in response to a return to said wrapper from said routine.
Claim 6
Independent Claim 230 words
A method for modifying a multithread shared library computer system in which an underlying function call exported from said shared library invokes a pointer to a function descriptor which, in turn, invokes a pointer to a corresponding routine of said shared library thereby causing execution of said routine, whereby multithread safe use of said shared library is facilitated said method comprising: providing a wrapper including a lock being comprised of program code extending around instantiation of said underlying function call, said wrapper being responsive to a call corresponding to said underlying call and including a lock for said routine, said wrapper further including said function descriptor; providing a substitute function descriptor with a pointer to said wrapper; changing said pointer to said function descriptor into a pointer to said substitute function descriptor; invoking said pointer to said substitute function descriptor; invoking with said pointer to said substitute function descriptor said pointer to said wrapper; and invoking with said pointer to said wrapper execution of said wrapper including executing said routine from said function call sequentially through said substitute function descriptor and then through said wrapper including said function descriptor; executing a lock on said routine; invoking said pointer of said function descriptor in said wrapper to said routine thereby causing its execution; and unlocking said lock on said routine in response to a return to said wrapper from said routine.
Claim 7
Dependent Claim 36 words
The method of claim 4 wherein said lock and said unlocking precludes and permits, respectively, execution of said routine from a subsequent said function call from another of said multiple threads while said routine is executing.
Claim 8
Independent Claim 206 words
A system for use in a multithread computer system employing a pre-existing shared library having a pre-existing function descriptor, a pointer to said function descriptor, and a corresponding at least one function which is not multithread-safe when used in said system having a corresponding underlying call associated therewith exported from said library to render said shared library multithread-safe when used in said system, comprising: means for creating a wrapper for said function comprised of program code extending around instantiation of said underlying call, said wrapper being responsive to a call corresponding to said underlying call, said means for creating a wrapper further including means for storing said pre-existing function descriptor therewithin; and means for creating a lock to said function; and means for rebinding said pre-existing shared library with said wrapper said means for rebinding including means for creating a modified function descriptor including means for creating a pointer to said wrapper and means for creating a copy of said function descriptor with said pointer to said wrapper in said modified function descriptor, being substituted for said pointer to said function in said function descriptor during said rebinding; and means for substituting a pointer to said modified pointer descriptor for said pointer to said function descriptor.
Claim 9
Independent Claim 206 words
A system for use in a multithread computer system employing a pre-existing shared library having a pre-existing function descriptor, a pointer to said function descriptor, and a corresponding at least one function which is not multithread-safe when used in said system having a corresponding underlying call associated therewith exported from said library to render said shared library multithread-safe when used in said system, comprising: means for creating a wrapper for said function comprised of program code extending around instantiation of said underlying call, said wrapper being responsive to a call corresponding to said underlying call, said means for creating a wrapper further including means for storing said pre-existing function descriptor therewithin; and means for creating a lock to said function; and means for rebinding said pre-existing shared library with said wrapper said means for rebinding including means for creating a modified function descriptor including means for creating a pointer to said wrapper and means for creating a copy of said function descriptor with said pointer to said wrapper in said modified function descriptor, being substituted for said pointer to said function in said function descriptor during said rebinding; and means for substituting a pointer to said modified pointer descriptor for said pointer to said function descriptor.

References Cited (Backward Citations)

US4663709A Cited
US4847754A Cited
US5047919A Cited
US5109511A Cited
US5353418A Cited
US5230070A Cited
US5226143A Cited
US5339415A Cited
US5305448A Cited
US5339427A Cited
US5375241A Cited

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 1999-01-01 1999-07-03 2000-01-02 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 2003-01-01 2003-07-03 2004-01-02 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 2007-01-01 2007-07-03 2008-01-02 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag