IP Library Granted Patent US 8,060,880
Granted Patent B2
US 8,060,880 · App. 11/744,642 · Granted Nov 15, 2011

System using backward inter-procedural analysis for determining alternative coarser grained lock when finer grained locks exceeding threshold

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,060,880
App. No.
11/744,642
Granted
Nov 15, 2011
Kind
B2
Abstract

Locks which protect data structures used within atomic sections of concurrent programs are inferred from atomic sections and acquired in a manner to avoid deadlock. Locks may be inferred by expression correspondence using a backward inter-procedural analysis of an atomic section. Locks may be sorted according to a total order and acquired early in an atomic section to prevent deadlock. Multiple granularity of locks are determined and employed. Fine grained locks may be inferred and acquired to reduce contention. Coarse grained locks may be determined and substituted for fine grained locks when necessary for unbounded locations or to reduce the number of finer grained locks.

Claims (24)

1. A computer-implemented method of acquiring one or more locks within a concurrent program, the method comprising:

identifying an atomic section within the concurrent program, the atomic section including a plurality of statements that reference a plurality of variables used within the atomic section, wherein each variable refers to a memory location;

performing a backwards inter-procedural analysis on the atomic section to determine which of the memory locations need to be locked during execution of the atomic section, the backwards inter-procedural analysis comprising examining lines of code within the atomic section in a bottom to top order, the backward inter-procedural analysis including determining that a memory location is referred to by more than one of the plurality of variables, and placing a fine grained lock on only one of the more than one variables which refer to the memory location;

after performing the backwards inter-procedural analysis, determining a number of fine grained locks which were placed on the variables of the atomic section; and

upon the number of fine grained locks exceeding a specified bound K, determining one or more alternative coarser grained locks to be used in place of the fine grained locks such that the number of locks for the atomic section do not exceed the specified bound K.

2. The method of claim 1 further comprising:

acquiring the alternative coarser grained locks in either a pre-order or a post-order.

3. The method of claim 1 wherein the alternative coarser grained locks are acquired by a runtime library.

4. The method of claim 1 wherein the locks are determined by a compiler system.

5. The method of claim 1 wherein at least one of the one or more alternative coarser grained locks is a fictitious lock.

6. The method of claim 1 wherein the locks determined are disjoint.

7. A computer-implemented method of determining one or more locks to be acquired for a concurrent program, the method comprising:

identifying an atomic section of the concurrent program, the atomic section including a plurality of statements that reference a plurality of variables used within the atomic section, wherein each variable refers to a memory location;

determining expression correspondence for the atomic section by performing a backwards inter-procedural analysis on the atomic section to determine which of the memory locations need to be locked during execution of the atomic section, the backwards inter-procedural analysis comprising examining lines of code within the atomic section in a bottom to top order, the backward inter-procedural analysis including determining that a memory location is referred to by more than one of the plurality of variables, and placing a fine grained lock on only one of the more than one variables which refer to the memory location;

after performing the backwards inter-procedural analysis, determining a number of fine grained locks which were placed on the variables of the atomic section; and

upon the number of fine grained locks exceeding a specified bound K, determining one or more alternative coarser grained locks to be used in place of the fine grained locks such that the number of locks for the atomic section do not exceed the specified bound K.

8. The method of claim 7 wherein at least one of the one or more alternative coarser grained locks is a fictitious lock.

9. The method of claim 7 wherein the locks determined are disjoint.

10. A computer program product comprising one or more physical computer-readable media having instructions encoded thereon which, when executed, implement a method of determining locks to be acquired for an atomic section of a concurrent program, the method comprising:

identifying an atomic section of the concurrent program, the atomic section including a plurality of statements that reference a plurality of variables used within the atomic section, wherein each variable refers to a memory location;

performing a backwards inter-procedural analysis on the atomic section to determine which of the memory locations need to be locked during execution of the atomic section, the backwards inter-procedural analysis comprising examining lines of code within the atomic section in a bottom to top order, the backward inter-procedural analysis including determining that a memory location is referred to by more than one of the plurality of variables, and placing a fine grained lock on only one of the more than one variables which refer to the memory location;

after performing the backwards inter-procedural analysis, determining a number of fine grained locks which were placed on the variables of the atomic section; and

upon the number of fine grained locks exceeding a specified bound K, determining one or more alternative coarser grained locks to be used in place of the fine grained locks such that the number of locks for the atomic section do not exceed the specified bound K.

11. The method of claim 10 wherein determining alternative coarser grained locks comprises determining group level locks.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 9, 2014
From: MICROSOFT CORPORATION
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 034542/0001 →