⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 libtp_usenix.ps

📁 介绍:MySQL是比较出名的数据库软件
💻 PS
📖 第 1 页 / 共 5 页
字号:
2185 1884 MXY-31 -20 Dl12 20 Dl-12 19 Dl31 -19 Dl-356 0 Dl0 -803 Dl3 f17 s1236 1851(Lock)N1118 2030(M)N1247(anager)X2339 1851(Log)N2187 2030(M)N2316(anager)X3333 1851(Buffer)N3257 2030(M)N3386(anager)X3522 1616 MXY20 -30 Dl-20 11 Dl-20 -11 Dl20 30 Dl0 -535 Dl1950 2654(Process)N2424(M)X2553(anager)X2542 1616 MXY19 -30 Dl-19 11 Dl-20 -11 Dl20 30 Dl0 -535 Dl1 f11 s2207 1364(unlock)N2452 2508 MXY20 -31 Dl-20 11 Dl-19 -11 Dl19 31 Dl0 -357 Dl2497 2322(sleep_on)N2497 2233(wake)N3 Dt-1 Ds3 f10 s1790 2830(Figure)N2037(1:)X2144(Library)X2435(module)X2708(interfaces.)X1 f10 f555 3010(h)N579(hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh)X3 f555 3286(3.2.1.)N775(The)X928(Log)X1081(Manager)X1 f755 3409(The)N3 f907(Log)X1067(Manager)X1 f1406(enforces)X1706(the)X1831(write-ahead)X2238(logging)X2509(protocol.)X2843(Its)X2949(primitive)X3268(operations)X3628(are)X2 f3753(log)X1 f3855(,)X2 f3901(log_commit)X1 f4279(,)X2 f555 3499(log_read)N1 f844(,)X2 f889(log_roll)X1 f1171(and)X2 f1312(log_unroll)X1 f1649(.)X1714(The)X2 f1864(log)X1 f1991(call)X2132(performs)X2447(a)X2508(buffered)X2806(write)X2996(of)X3088(the)X3211(speci\256ed)X3520(log)X3646(record)X3876(and)X4016(returns)X4263(a)X555 3589(unique)N809(log)X947(sequence)X1278(number)X1559(\(LSN\).)X1840(This)X2017(LSN)X2203(may)X2376(then)X2549(be)X2660(used)X2842(to)X2939(retrieve)X3220(a)X3291(record)X3532(from)X3723(the)X3856(log)X3993(using)X4201(the)X2 f555 3679(log_read)N1 f865(call.)X1042(The)X2 f1188(log)X1 f1311(interface)X1614(knows)X1844(very)X2008(little)X2175(about)X2374(the)X2493(internal)X2759(format)X2993(of)X3080(the)X3198(log)X3320(records)X3577(it)X3641(receives.)X3965(Rather,)X4219(all)X555 3769(log)N681(records)X942(are)X1065 0.4028(referenced)AX1430(by)X1534(a)X1594(header)X1833(structure,)X2158(a)X2218(log)X2344(record)X2574(type,)X2756(and)X2896(a)X2956(character)X3276(buffer)X3497(containing)X3859(the)X3981(data)X4138(to)X4223(be)X555 3859(logged.)N834(The)X980(log)X1103(record)X1330(type)X1489(is)X1563(used)X1731(to)X1814(call)X1951(the)X2070(appropriate)X2457(redo)X2621(and)X2758(undo)X2939(routines)X3217(during)X2 f3446(abort)X1 f3639(and)X2 f3775(commit)X1 f4031(process-)X555 3949(ing.)N721(While)X941(we)X1059(have)X1235(used)X1406(the)X3 f1528(Log)X1684(Manager)X1 f2019(to)X2104(provide)X2372(before)X2601(and)X2740(after)X2911(image)X3130(logging,)X3417(it)X3484(may)X3645(also)X3797(be)X3896(used)X4066(for)X4183(any)X555 4039(of)N642(the)X760(logging)X1024(algorithms)X1386(discussed.)X755 4162(The)N2 f905(log_commit)X1 f1308(operation)X1636(behaves)X1920(exactly)X2177(like)X2322(the)X2 f2445(log)X1 f2572(operation)X2900(but)X3026(guarantees)X3394(that)X3538(the)X3660(log)X3786(has)X3917(been)X4093(forced)X555 4252(to)N643(disk)X802(before)X1034(returning.)X1394(A)X1478(discussion)X1837(of)X1930(our)X2063(commit)X2333(strategy)X2613(appears)X2884(in)X2971(the)X3094(implementation)X3621(section)X3873(\(section)X4152(4.2\).)X2 f555 4342(Log_unroll)N1 f935(reads)X1126(log)X1249(records)X1507(from)X1684(the)X1803(log,)X1946(following)X2278(backward)X2611(transaction)X2983(pointers)X3261(and)X3397(calling)X3635(the)X3753(appropriate)X4139(undo)X555 4432(routines)N839(to)X927(implement)X1295(transaction)X1673(abort.)X1904(In)X1997(a)X2059(similar)X2307(manner,)X2 f2594(log_roll)X1 f2877(reads)X3073(log)X3201(records)X3464(sequentially)X3877(forward,)X4178(cal-)X555 4522(ling)N699(the)X817(appropriate)X1203(redo)X1366(routines)X1644(to)X1726(recover)X1988(committed)X2350(transactions)X2753(after)X2921(a)X2977(system)X3219(crash.)X3 f555 4708(3.2.2.)N775(The)X928(Buffer)X1171(Manager)X1 f755 4831(The)N3 f912(Buffer)X1167(Manager)X1 f1511(uses)X1681(a)X1749(pool)X1923(of)X2022(shared)X2264(memory)X2563(to)X2657(provide)X2934(a)X3002(least-recently-used)X3641(\(LRU\))X3886(block)X4095(cache.)X555 4921(Although)N886(the)X1013(current)X1270(library)X1513(provides)X1818(an)X1923(LRU)X2112(cache,)X2345(it)X2418(would)X2647(be)X2752(simple)X2994(to)X3085(add)X3229(alternate)X3534(replacement)X3955(policies)X4232(as)X555 5011(suggested)N903(by)X1015([CHOU85])X1408(or)X1507(to)X1601(provide)X1878(multiple)X2176(buffer)X2405(pools)X2610(with)X2784(different)X3092(policies.)X3412(Transactions)X3853(request)X4116(pages)X555 5101(from)N736(the)X859(buffer)X1081(manager)X1383(and)X1524(keep)X1701(them)X3 f1886(pinned)X1 f2145(to)X2232(ensure)X2466(that)X2610(they)X2772(are)X2895(not)X3021(written)X3272(to)X3358(disk)X3515(while)X3717(they)X3879(are)X4002(in)X4088(a)X4148(logi-)X555 5191(cally)N732(inconsistent)X1135(state.)X1343(When)X1556(page)X1729(replacement)X2143(is)X2217(necessary,)X2571(the)X3 f2689(Buffer)X2932(Manager)X1 f3264(\256nds)X3439(an)X3535(unpinned)X3853(page)X4025(and)X4161(then)X555 5281(checks)N794(with)X956(the)X3 f1074(Log)X1227(Manager)X1 f1559(to)X1641(ensure)X1871(that)X2011(the)X2129(write-ahead)X2529(protocol)X2816(is)X2889(enforced.)X3 f555 5467(3.2.3.)N775(The)X928(Lock)X1121(Manager)X1 f755 5590(The)N3 f901(Lock)X1095(Manager)X1 f1428(supports)X1720(general)X1978(purpose)X2253(locking)X2514(\(single)X2753(writer,)X2986(multiple)X3273(readers\))X3553(which)X3769(is)X3842(currently)X4152(used)X555 5680(to)N638(provide)X904(two-phase)X1254(locking)X1514(and)X1650(high)X1812(concurrency)X2230(B-tree)X2451(locking.)X2751(However,)X3086(the)X3204(general)X3461(purpose)X3735(nature)X3956(of)X4043(the)X4161(lock)X6 p%%Page: 6 610 s 10 xH 0 xS 1 f3 f1 f555 630(manager)N857(provides)X1158(the)X1281(ability)X1510(to)X1597(support)X1862(a)X1923(variety)X2171(of)X2263(locking)X2528(protocols.)X2890(Currently,)X3241(all)X3345(locks)X3538(are)X3661(issued)X3885(at)X3967(the)X4089(granu-)X555 720(larity)N747(of)X837(a)X896(page)X1071(\(the)X1219(size)X1367(of)X1457(a)X1516(buffer)X1736(in)X1821(the)X1942(buffer)X2161(pool\))X2352(which)X2570(is)X2645(identi\256ed)X2969(by)X3071(two)X3213(4-byte)X3440(integers)X3716(\(a)X3801(\256le)X3925(id)X4009(and)X4147(page)X555 810(number\).)N898(This)X1071(provides)X1378(the)X1507(necessary)X1851(information)X2259(to)X2351(extend)X2595(the)X3 f2723(Lock)X2926(Manager)X1 f3268(to)X3360(perform)X3649(hierarchical)X4059(locking)X555 900([GRAY76].)N982(The)X1133(current)X1387(implementation)X1915(does)X2088(not)X2216(support)X2482(locks)X2677(at)X2760(other)X2950(granularities)X3376(and)X3517(does)X3689(not)X3816(promote)X4108(locks;)X555 990(these)N740(are)X859(obvious)X1132(future)X1344(additions)X1657(to)X1739(the)X1857(system.)X755 1113(If)N831(an)X929(incoming)X1253(lock)X1413(request)X1667(cannot)X1903(be)X2001(granted,)X2284(the)X2404(requesting)X2760(process)X3023(is)X3098(queued)X3352(for)X3467(the)X3586(lock)X3745(and)X3882(descheduled.)X555 1203(When)N769(a)X827(lock)X987(is)X1062(released,)X1368(the)X1488(wait)X1647(queue)X1860(is)X1934(traversed)X2250(and)X2387(any)X2524(newly)X2741(compatible)X3118(locks)X3308(are)X3428(granted.)X3730(Locks)X3947(are)X4067(located)X555 1293(via)N680(a)X743(\256le)X872(and)X1015(page)X1194(hash)X1368(table)X1551(and)X1694(are)X1820(chained)X2097(both)X2266(by)X2373(object)X2595(and)X2737(by)X2843(transaction,)X3241(facilitating)X3614(rapid)X3805(traversal)X4108(of)X4201(the)X555 1383(lock)N713(table)X889(during)X1118(transaction)X1490(commit)X1754(and)X1890(abort.)X755 1506(The)N907(primary)X1188(interfaces)X1528(to)X1617(the)X1742(lock)X1907(manager)X2211(are)X2 f2337(lock)X1 f2471(,)X2 f2518(unlock)X1 f2732(,)X2779(and)X2 f2922(lock_unlock_all)X1 f3434(.)X2 f3500(Lock)X1 f3682(obtains)X3939(a)X4001(new)X4161(lock)X555 1596(for)N680(a)X747(speci\256c)X1023(object.)X1290(There)X1509(are)X1638(also)X1797(two)X1947(variants)X2231(of)X2328(the)X2 f2456(lock)X1 f2620(request,)X2 f2902(lock_upgrade)X1 f3373(and)X2 f3519(lock_downgrade)X1 f4053(,)X4103(which)X555 1686(allow)N755(the)X875(caller)X1076(to)X1160(atomically)X1519(trade)X1701(a)X1758(lock)X1917(of)X2005(one)X2142(type)X2301(for)X2416(a)X2473(lock)X2632(of)X2720(another.)X2 f3022(Unlock)X1 f3275(releases)X3551(a)X3608(speci\256c)X3874(mode)X4073(of)X4161(lock)X555 1776(on)N655(a)X711(speci\256c)X976(object.)X2 f1232(Lock_unlock_all)X1 f1786(releases)X2061(all)X2161(the)X2279(locks)X2468(associated)X2818(with)X2980(a)X3036(speci\256c)X3301(transaction.)X3 f555 1962(3.2.4.)N775(The)X928(Process)X1207(Manager)X1 f755 2085(The)N3 f900(Process)X1179(Manager)X1 f1511(acts)X1656(as)X1743(a)X1799(user-level)X2136(scheduler)X2464(to)X2546(make)X2740(processes)X3068(wait)X3226(on)X3326(unavailable)X3716(locks)X3905(and)X4041(pending)X555 2175(buffer)N778(cache)X988(I/O.)X1161(For)X1297(each)X1470(process,)X1756(a)X1817(semaphore)X2190(is)X2268(maintained)X2649(upon)X2834(which)X3055(that)X3200(process)X3466(waits)X3660(when)X3859(it)X3928(needs)X4136(to)X4223(be)X555 2265(descheduled.)N1014(When)X1228(a)X1286(process)X1549(needs)X1754(to)X1838(be)X1936(run,)X2084(its)X2180(semaphore)X2549(is)X2623(cleared,)X2897(and)X3034(the)X3153(operating)X3477(system)X3720(reschedules)X4116(it.)X4201(No)X555 2355(sophisticated)N1002(scheduling)X1378(algorithm)X1718(is)X1799(applied;)X2085(if)X2162(the)X2288(lock)X2454(for)X2576(which)X2800(a)X2864(process)X3133(was)X3286(waiting)X3554(becomes)X3863(available,)X4201(the)X555 2445(process)N824(is)X905(made)X1107(runnable.)X1456(It)X1533(would)X1761(have)X1941(been)X2121(possible)X2411(to)X2501(change)X2757(the)X2883(kernel's)X3170(process)X3439(scheduler)X3775(to)X3865(interact)X4134(more)X555 2535(ef\256ciently)N900(with)X1062(the)X1180(lock)X1338(manager,)X1655(but)X1777(doing)X1979(so)X2070(would)X2290(have)X2462(compromised)X2918(our)X3045(commitment)X3469(to)X3551(a)X3607(user-level)X3944(package.)X3 f555 2721(3.2.5.)N775(The)X928(Transaction)X1361(Manager)X1 f755 2844(The)N3 f901(Transaction)X1335(Manager)X1 f1668(provides)X1965(the)X2084(standard)X2377(interface)X2680(of)X2 f2768(txn_begin)X1 f3084(,)X2 f3125(txn_commit)X1 f3499(,)X3540(and)X2 f3676(txn_abort)X1 f3987(.)X4047(It)X4116(keeps)X555 2934(track)N742(of)X835(all)X941(active)X1159(transactions,)X1588(assigns)X1845(unique)X2089(transaction)X2467(identi\256ers,)X2833(and)X2974(directs)X3213(the)X3336(abort)X3526(and)X3

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -