United States Patent [191 Hart lllllllllllllllllllllllllllIllllIllllllllllllllIlllllllllllllllllllllllllll US005285528A [11] Patent Number: 5,285,528 [45} Date of Patent: Feb. 8, 1994 [54] DATA STRUCTURES AND AIA'J‘ORITHMS FOR MANAGING LOCK STATES OF ADDRESSABLE ELEMENT RANGES [75] Inventor: Caawall A. Hart, Millwood, N.Y. [73] Assignee: International Business Machines Corporation, Armonk, NY. [21] App]. No.: 660,451 [22] Filed: Feb. 22, 1991 [51] Int. Cl.5 ............................................ .. G06F 12/00 [52] U.S. Cl. ............................... .. 395/725; 364/2468; 364/2815; 364/D1G. 1; 364/9692; 364/D1G. 2 [58] Field of Search ............. .. 395/725, 650, 425, 325; 364/2468, 281.5, DIG. 1, 969.2, D16. 2 [56] References Cited U.S. PATENT DOCUMENTS 4,087,752 5/1978 Melvin ...................... ........ .. 325/30 4,480,304 10/1984 Carr et a1. . .. 395/725 4,574,350 3/1986 Starr ........ .. 395/725 4,709,326 11/1987 Robinson .... .. 395/725 4,716,528 12/1987 Crus et a]. . . . . . . . . . .. 395/650 4,763,244 8/ 1988 Meyer et al. . 364/200 4,766,537 8/1988 Zolnowsky .. 364/200 4,800,489 1/1989 Moyer et a1. .. .... .. 364/200 4,823,310 4/1989 Grand . . . . . . . . . . . . . . . . .. 364/900 5,060,144 10/1991 Sipple =1 a1. .... .. 395/650 5,089,952 2/1992 Bozman . . . . . . . . . . . . . .. 395/725 5,140,685 8/1992 Sipple et al. 395/425 5,161,227 11/1992 Dias et a1. .... .. 395/725 5,175,852 12/1992 Johnson et a1. ................... .. 395/600 OTHER PUBLICATIONS "Operating Systems“; Lorin et al.; Addison-Wesley; 1981; Chapter 12. "The UNIX Programming Environment"; Keringham et al.; Prentice Hall, Inc.; 1984. “An Introduction to Operating Systems"; Dietel; Ad dison-Wesley; 1984; Chapter 21. “An Introduction to Database Systems"; Date; vol. 1; 3rd Edition; Addison-Wesley; 1981. , “Data Structures and Program Design”; Kruse; 2nd edition; Prentice-Hall; 1984; p. 344. - “Locking Protocols for Concurrent Operations on B- Trees"; Bayer et al; IBM Technical Disclosure Bulletin; vol. 19; No. 10; Mar. 1977. Primary Examiner-Michael R. Fleming Assistant Examiner-Glenn A. Auve Attorney. Agent, or Firm-Whitman & Marhoefer [5 7] ABSTRACT An efficient algorithm for addressable element range locking in shared resources, such as tiles and memory, of a multi-tasking or multi-processor data processing system provides a very fast mechanism that can prop erly handle overlapping requests to lock ranges of data of the data processing system while locking or granting wait status to a requestor for any more of the shared resource than is actually requested. This is accom plished by providing singular descriptions of locked and requested ranges of addressable elements. As further requests are received or locks released on overlapping ranges of addressable elements, these singular descrip tions are divided or recombined into other singular descriptions of non-overlapping ranges. Problems of overlapping requests are thus handled by dynamically decomposing requests into non-overlapping segments which are then granted atomically. Fast searching for potential deadlocks is accomplished by placing control information about locked areas into a binary tree struc ture. 26 Claims, 19 Drawing Sheets [44 m IAIIGUl 1114 mm 5111‘!!! ,vlO cot “I fit! SIIIEI 52 4 " - “D an 1 nus MS 35 III 1013M Mg: IUIMI qiPévu M30
32
Embed
METHODS OF FORECASTING MORTALITY USING AUSTRALIAN DATA
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
5,140,685 8/1992 Sipple et al. 395/425 5,161,227 11/1992 Dias et a1. .... .. 395/725
5,175,852 12/1992 Johnson et a1. ................... .. 395/600
OTHER PUBLICATIONS
"Operating Systems“; Lorin et al.; Addison-Wesley; 1981; Chapter 12.
"The UNIX Programming Environment"; Keringham et al.; Prentice Hall, Inc.; 1984. “An Introduction to Operating Systems"; Dietel; Ad dison-Wesley; 1984; Chapter 21. “An Introduction to Database Systems"; Date; vol. 1; 3rd Edition; Addison-Wesley; 1981. , “Data Structures and Program Design”; Kruse; 2nd edition; Prentice-Hall; 1984; p. 344. - “Locking Protocols for Concurrent Operations on B- Trees"; Bayer et al; IBM Technical Disclosure Bulletin; vol. 19; No. 10; Mar. 1977.
Primary Examiner-Michael R. Fleming Assistant Examiner-Glenn A. Auve Attorney. Agent, or Firm-Whitman & Marhoefer
[5 7] ABSTRACT An efficient algorithm for addressable element range locking in shared resources, such as tiles and memory, of a multi-tasking or multi-processor data processing system provides a very fast mechanism that can prop erly handle overlapping requests to lock ranges of data of the data processing system while locking or granting wait status to a requestor for any more of the shared resource than is actually requested. This is accom plished by providing singular descriptions of locked and requested ranges of addressable elements. As further requests are received or locks released on overlapping ranges of addressable elements, these singular descrip tions are divided or recombined into other singular descriptions of non-overlapping ranges. Problems of overlapping requests are thus handled by dynamically decomposing requests into non-overlapping segments which are then granted atomically. Fast searching for potential deadlocks is accomplished by placing control information about locked areas into a binary tree struc ture.
26 Claims, 19 Drawing Sheets
[44 m IAIIGUl
1114 mm 5111‘!!!
,vlO
cot “I fit! SIIIEI
52 4
" - “D an
1 nus
MS 35
III
1013M Mg: IUIMI
qiPévu M30
US. Patent Feb. 8, 1994 Sheet 1 of 19 5,285,528
1 j 1 Wm coma‘ LOCK NANRGER CACHE MANAGER
‘ 46 "mm" IRE COMMON SHARED / "
[RN FILE SERVER
4Q I 501 ' 5251 1 l 1
"F5 5MB sue PROT0 - PRUTD- PROTO CUL 00!. URL CONVER~ gggVER- (iggVER mm!) (005) (03/2)
3"\ WE LAN SERVER PLATFORM SHARED W) —A MULIIMSKING WORK DISPATCIIER
5/510 SYSTEM comm PROGRAM ‘2 /1./
WM 0R NVS)
5/310 LAN will
ADAPTER FIG. i 22
\ [/24 005 005
3% 16 AH 05/2
LOCAL AREA NETWORK “x 2-0 05/2
\34 28 05/2 M32 05/2 M30
U.S. Patent Feb. 8, 1994 Sheet 2 of 19 5,285,528
45 5O
5 ' l I
26 30 TI 80 I l
‘ 1 I0 20 3540 65b7[) 85 9O
FIG.2
45 50
I l '
26 30 TI 80
r. ________ __
LOCIW as 40 65 10 as 90
WI '5 2o
l DELAY GRANT l
U.S. Patent Feb. 8, 1994 Sheet 4 of 19 5,285,528
sua-nourme on . O HG 6 EXTERNAL ROUTINE cm
(mm) 101 [m
an FREE CREATE FREE us1 Y SIORAGE run or MODES mom
/ nnunu= cmumocn 6c ‘INVALID mac v RANGE REQUEST" PROJOESSOR
110/ [m [N ynmm' cm um 100K’
0 FORCE _ "00E rnou USERS comma LOCKED ouwe
US. Patent Feb. 8, 1994 Sheet 5 of 19 5,285,528
(:63 1 @D 205
GETRANGE 100E anunn- mums TIIENUDE REIURN mcuoou WWO FROM "mac ALREADY rmumeusm's -~N_l runs 10 THE - mPln P-USI [UCKED' M51 or OWNED FREE NDDES POOL
LOCKS
on & um a mom: ,202 10 m I
HIEREOUEST
[20a OUEUE HIE NUDE TO THE usm's us] or emu LOCKS
‘ [204 INSERT IliE cum ma um) "00E mm IIIE "1 22? 100x BEFORE - “2" LUCK T‘REE ‘HG-6"’ mum; USER V
205
YES YES
NO I23: JZM BALANCE IIIE 7 mm TiEiTlR?-"MNEF I LOOK IREE - mm [0 BE WMI WOULD ——
Ir NECESSARY I WMIED CAUSE vuwwcx"
'8 7/2“! REIURN
m'gmsfvmc 'LOCKGRANIED'
neouwc rm§1 NUDE 0" "IE
SIMIK
US. Patent Feb. 8, 1994 Sheet 6 of 19 5,285,528
FROM ZKHF l8.6b) 41 arms
DECOMPOSE EXISIING RooE-uRRE R RIGHT PEER a STACK FUR INSERT
22a
nEcoMPosE NEW DECOMPOSE EXISHNG ‘ LmnE-MRRE R 5m“ "5 RonE-uRRE R * ‘LEFT PEER R -" R'GHT'S'DE LEFT PEER R STACK FOR INSERT VSTACK- FUR INSERT
s??g‘yj'?ffk?xg“ DECOMPOSE NEW RIGHTPEEM " NODE‘MM‘E A +
STACK roRmsEm mam PEER & STACK ERR INSERT
mm PEER & — DECOMPOSE EXISTING SIACKFOR INSERT NODE'WE A »
EEH PEER & STACK FOR INSERT
MUSI BE RIGHT-SIDE comRmREm
DECOMPDSE EXISTING DECUMPOSE NEW DECOMPOSE NE" uooE-uRRE EEm RouE-RRRE LEm RonE-MRRE A mam PEER a mom PEERR LIEFI PEER a 5mm FOR INSERT sIRcR FOR INSERI STACK FOR msERI
:25: e we: we: 5: 52.3 £5 :2: E 2\ §.\ 25%: t 3.3:: d EFFE 5E me: E .
:5 :2: .3 mi
US. Patent Feb. 8, 1994 Sheet 10 of 19 5,285,528
.63 59:22 E m8: 5% E5 255m 233$: ..= 35355 d SE ME :2: was: $52.5 52mm E8 E5 mmwm CS 2;
75
25,232 m_ as we; 35:2 a 52:2: 2 5E 12m U8: US: 55.5”,
35:: E5: a m:
as .E: h?m wEEQZE, Q2 52 .5 55:92,? 9E5 w: E :2 $55 5: 2
oz
:2 was. 525: e we: 5% :2 552
we:
EMEQ 2333: m_ P Q , $255: 55 J: 33 .5: we:
5: =2 Us; 2. I. L! 1-.
52 B ‘ 5.55 .35 L...
US. Patent Feb. 8, 1994 Sheet 11 of 19 5,285,528
F I G. 6 e mm "ODE/RANGE 00101100510011
506 /501 ‘ // 1110015: 11005 '111111 )0?
1111105 10 0£00111>0sE / 100111101 DE
s100£ 001111 01 OOMPOSH'ON 1110111001111 01 05001100011011 115 /502 01001100011011 1s sun-11111105 501111 7 5110-1111105 END or or 11005 1 m A 5509"” NUDE 1
1111151100152 1111115 MODE 2 1511-1111511 RIGHT-PEER 0F "00E I SECOND NUDE of "005 1
01001112 0005 BMW“ 0100111 00111 REQUEST -
END
US. Patent Feb. 8, 1994 Sheet 13 of 19 5,285,528
=25 w< 3.: 4 52.5 533g 20 x 5t; 52
:5 $3.53 zo 2:5; m 58 5.72
Kw;
miouvag zo 2E; :52; 5.5.‘ 5.5;; 5:;
$6-53 zo ?t; GEL 5:;
mm» “um. to :3 2
m 5% E 52: . 53 .EE m5 nm “6 53 m 52 w< 5E magma/(5
US. Patent Feb. 8, 1994 Sheet 14 of 19 5,285,528
. a .2: at a m m
$22.29“ 3 m2”. 5 a N _
Emit
iii :5 $953.; E 5 £03; 1
m N 9
& 2552 23 gmgég
mm
W»
El 12 % E m J z A
3: Eng N2 2 =2.
.1
8 @N
_8 Q E g/
52.2%?“ m. 52.5 wk 59% 3; . 2t 2 8 zz-fb
DEWEUE FIRST ' NUDE ON THE
STACK
US. Patent Feb. 8, 1994 Sheet 15 of 19 5,285,528
mm FIG._8
came: 10 BE anuau- DEOUEUE magma mum: mwoon LOCKED FROM ‘RANGE ALREADY moumsusms ALL mas 10 THE - INPUT P-UST LOCKED‘ LIST or OWNED rm NODESPOOL _
LOCKS
on 1 nm A NUDE T0 MP
me mum
OUEUE muons to Hit uszn's usr or ovmco LOCKS
INSERT THE "ODE mm THE
0 we‘ WEK IREE CHECK roa DEAD I F LOCK BEFORE wmms USER
was
no
amuse THE LOOK TREE
IF NECESSARY mmcm RETURN-‘RANGE. - USER m BE mm wouLo ,
mm muss DEADLOCK'
anmm ' 00"‘ “SE 5m “LOCK GRANTED‘
REIURN -
'IlMED-OUI 0N LOCK WAIT'
US. Patent Feb. 8, 1994 Sheet 16 of 19 5,285,528
momma: "0
DEOOMPOSE EXISIING NUDE-MAKE A ‘mam PEER l STACK ron msm
DECOMPUSE maw OEOOMPOSE EXISHNG E NUDE-MAKE A MODE-MAKE A __
LEH PEER A " LEFT PEEAA sIAcA ron INSERT STACK FOR mscm
DECOMPOSE EXIST. SNUDFMME A DECOMPUSE NEW RIGHIPEEM " "ODE-WE A _A
sum FOR INSERT mom PEER A sIAcA FOR INSERT
orcomseusw '
LEFT-SIDE "9 MODE-MAKE A DECUMPOSE EXISTING NO0E—MM(E A LEFT PEER E STACK FUR INSERT
mNIAINMENI mcmPEEAA "'
STACK FOR mam
N0 TOTAL N0 CONIMNMENI MUST as
mcm-sms YES "5 CONTAINMENT
oscoumss EXISTING DECOMPUSE NEW ‘ DECOMPOSE m AooE-AAAE um NUDE-MAKE LEHA MODE-MAKE A mam PEER & mam PEER A LE" PEER l sTAcA ron mam STACK FOR mscm STACK FOR INSERT
FIG. 6, km no.0. 2151
U.S. Patent Feb. 8, 1994 Sheet 18 of 19 5,285,528
NW2.‘ 5% m5; :2 N
0.2“
em ZEHHEE w 5538M; mdE 8min!‘ m8: magma mac: 2 5.2-. §\