{"id":164,"date":"2017-08-19T15:09:02","date_gmt":"2017-08-19T15:09:02","guid":{"rendered":"http:\/\/www.luo666.com\/?p=164"},"modified":"2019-01-19T04:42:41","modified_gmt":"2019-01-19T04:42:41","slug":"mos-deadlock-detection-with-one-resource-of-each-type","status":"publish","type":"post","link":"http:\/\/www.luo666.com\/?p=164","title":{"rendered":"[MOS] deadlock detection"},"content":{"rendered":"<p>MOS: Modern Operating Systems<\/p>\n<h2>deadlock detection with one resource of each type<\/h2>\n<p><a href=\"https:\/\/i0.wp.com\/www.luo666.com\/wp-content\/uploads\/2017\/08\/deadlock-detection-one-resource.png\"><img data-attachment-id=\"165\" data-permalink=\"http:\/\/www.luo666.com\/?attachment_id=165\" data-orig-file=\"https:\/\/i0.wp.com\/www.luo666.com\/wp-content\/uploads\/2017\/08\/deadlock-detection-one-resource.png?fit=628%2C338\" data-orig-size=\"628,338\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"deadlock-detection-one-resource\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.luo666.com\/wp-content\/uploads\/2017\/08\/deadlock-detection-one-resource.png?fit=300%2C161\" data-large-file=\"https:\/\/i0.wp.com\/www.luo666.com\/wp-content\/uploads\/2017\/08\/deadlock-detection-one-resource.png?fit=628%2C338\" decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-165\" src=\"https:\/\/i0.wp.com\/www.luo666.com\/wp-content\/uploads\/2017\/08\/deadlock-detection-one-resource.png?resize=628%2C338\" alt=\"\" width=\"628\" height=\"338\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<div>\u5982\u679c\u6bcf\u79cd\u8d44\u6e90\u90fd\u662f\u72ec\u4e00\u4efd\u7684\uff0c\u53ef\u4ee5\u7528\u4e0a\u9762\u8fd9\u6837\u7684\u56fe\u6765\u5206\u6790\u8d44\u6e90\u7ade\u4e89\u60c5\u51b5\u3002<\/div>\n<div>\u56fe\u4e2d\u65b9\u5757\u4ee3\u8868\u8d44\u6e90\uff0c\u5706\u5f62\u4ee3\u8868\u8fdb\u7a0b\uff1b\u6307\u5411\u8fdb\u7a0b\u7684\u7bad\u5934\u8868\u793a\u8d44\u6e90\u88ab\u8be5\u8fdb\u7a0b\u62e5\u6709\uff0c\u800c\u4ece\u8fdb\u7a0b\u51fa\u53d1\u7684\u7bad\u5934\u8868\u793a\u5176\u9700\u8981\u7684\u8d44\u6e90\u3002<\/div>\n<div>\u6709\u5411\u56fe\u4e2d\u53ea\u8981\u5b58\u5728\u4e00\u4e2a\u95ed\u73af\uff0c\u5c31\u5b58\u5728\u4e00\u4e2a\u6b7b\u9501<\/div>\n<div>\n<hr \/>\n<\/div>\n<div>\u627e\u51fa\u95ed\u73af\u7684\u65b9\u6cd5\u6709\u5f88\u591a\u79cd\uff0c\u8fd9\u91cc\u7ed9\u51fa\u4e00\u4e2a\u6bd4\u8f83\u76f4\u89c2\u7684\u65b9\u6cd5\uff1a<\/div>\n<div>0\uff09\u9996\u5148\u628a\u56fe\u4e2d\u6240\u6709\u7bad\u5934\u8bb0\u4e3aunmarked\uff0c\u521d\u59cb\u5316\u4e00\u4e2a\u7a7a\u94fe\u8868L\uff0c\u5e76\u9009\u4e2d\u4e00\u4e2a\u8282\u70b9\uff08\u65e0\u8bba\u662f\u8fdb\u7a0b\u8fd8\u662f\u8d44\u6e90\uff0c\u8fd9\u91cc\u53ea\u8003\u8651\u62bd\u8c61\u51fa\u7684\u6709\u5411\u56fe\uff09\u4e3a\u5f53\u524d\u8282\u70b9<\/div>\n<div>1\uff09\u5224\u65ad\u8be5\u8282\u6709\u6ca1\u6709\u51fa\u73b0\u5728L\u4e2d\uff0c\u5982\u679c\u6ca1\u6709\u5219\u52a0\u5165L\u5c3e\u90e8\u8fdb\u5165\u4e0b\u4e00\u6b65\uff1b\u5982\u679c\u6709\u5219\u8bf4\u660e\u5b58\u5728\u4e00\u4e2a\u95ed\u73af\uff0c\u5373\u53d1\u73b0\u6b7b\u9501<\/div>\n<div>2\uff09\u5f53\u524d\u8282\u70b9\u5982\u679c\u6709\u5411\u5916\u7684unmarked\u7bad\u5934\u5c31\u987a\u7740\u5b83\u627e\u5230\u4e0b\u4e00\u4e2a\u8282\u70b9\uff0c\u540c\u65f6\u5c06\u8be5\u7bad\u5934\u6807\u8bb0\u4e3amarked\uff0c\u8df3\u52301\uff09\uff1b\u5982\u679c\u6ca1\u6709unmarked\u7bad\u5934\u8fdb\u5165\u4e0b\u4e00\u6b65<\/div>\n<div>3\uff09\u6ca1\u6709unmarked\u7684\u7bad\u5934\u8868\u660e\u5df2\u7ecf\u8fdb\u5165\u6b7b\u80e1\u540c\uff0c\u5220\u6389\u5f53\u524d\u8282\u70b9\uff0c\u56de\u6eaf\u5230\u6e90\u8282\u70b9\uff0c\u5c06\u5176\u8bbe\u7f6e\u4e3a\u5f53\u524d\u8282\u70b9\uff0c\u8df3\u52302\uff09<\/div>\n<div><\/div>\n<h2>deadlock detection with multiple resources of each type<\/h2>\n<p><a href=\"https:\/\/i0.wp.com\/www.luo666.com\/wp-content\/uploads\/2017\/08\/deadlock-detection-multi-resource.png\"><img data-attachment-id=\"168\" data-permalink=\"http:\/\/www.luo666.com\/?attachment_id=168\" data-orig-file=\"https:\/\/i0.wp.com\/www.luo666.com\/wp-content\/uploads\/2017\/08\/deadlock-detection-multi-resource.png?fit=695%2C349\" data-orig-size=\"695,349\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"deadlock-detection-multi-resource\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.luo666.com\/wp-content\/uploads\/2017\/08\/deadlock-detection-multi-resource.png?fit=300%2C151\" data-large-file=\"https:\/\/i0.wp.com\/www.luo666.com\/wp-content\/uploads\/2017\/08\/deadlock-detection-multi-resource.png?fit=695%2C349\" decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-168\" src=\"https:\/\/i0.wp.com\/www.luo666.com\/wp-content\/uploads\/2017\/08\/deadlock-detection-multi-resource.png?resize=695%2C349\" alt=\"\" width=\"695\" height=\"349\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<div>\u5f53\u4e00\u79cd\u8d44\u6e90\u6709\u591a\u4e2a\u53ef\u7528\u5b9e\u4f53\u65f6\uff0c\u6211\u4eec\u4f7f\u7528\u4e00\u79cd\u57fa\u4e8e\u77e9\u9635\u7684\u7b97\u6cd5<\/div>\n<div>\u5411\u91cfE\u8868\u793am\u79cd\u8d44\u6e90\u76ee\u524d\u88ab\u5360\u7528\u7684\u60c5\u51b5\uff0cA\u8868\u793am\u79cd\u8d44\u6e90\u5269\u4f59\u91cf<\/div>\n<div>\u77e9\u9635C\u8868\u793an\u4e2a\u8fdb\u7a0b\u76ee\u524d\u5206\u522b\u5360\u7528\u5404\u79cd\u8d44\u6e90\u7684\u60c5\u51b5\uff0c\u6bcf\u884c\u4ee3\u8868\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u6bcf\u5217\u662f\u4e00\u79cd\u8d44\u6e90\u5bf9\u5e94\u7684\u5404\u4e2a\u8fdb\u7a0b\u5360\u7528\u60c5\u51b5\uff0cm\u5217\u6c42\u548c\u5c31\u7b49\u4e8eEm<\/div>\n<div>\u77e9\u9635R\u8868\u793an\u4e2a\u8fdb\u7a0b\u76ee\u524d\u5bf9\u5404\u79cd\u8d44\u6e90\u7684\u9700\u6c42\u91cf\uff0c\u884c\u5217\u610f\u4e49\u540c\u4e0a<\/div>\n<div>\u5b9a\u4e49\u5411\u91cfX&lt;=Y\u5f53\u4e14\u4ec5\u5f53X\u7684\u6bcf\u4e2a\u5206\u91cf\u90fd&lt;=Y\u7684\u5bf9\u5e94\u5206\u91cf<\/div>\n<div><\/div>\n<div>\u7b97\u6cd5\u6b65\u9aa4\uff1a<\/div>\n<div>0\uff09\u6240\u6709\u8fdb\u7a0b\u6807\u8bb0\u4e3aunmarked<\/div>\n<div>1\uff09\u627e\u5230\u4e00\u4e2aunmarked\u8fdb\u7a0bi\uff0c\u5176\u5360\u7528\u7684\u8d44\u6e90Ri&lt;=A\uff0c\u4e0b\u4e00\u6b65\uff1b\u6ca1\u6709\u6ee1\u8db3\u8be5\u6761\u4ef6\u7684\u8fdb\u7a0b\uff0c\u8df3\u52303\uff09<\/div>\n<div>2\uff09A=A+Ci\uff0c\u8fdb\u7a0bi\u6807\u8bb0\u4e3amarked\uff0c\u8df3\u52301\uff09<\/div>\n<div>3\uff09\u5982\u679c\u6240\u6709\u8fdb\u7a0b\u90fd\u662fmarked\uff0c\u8868\u793a\u90fd\u5f97\u5230\u4e86\u6267\u884c\uff0c\u6ca1\u6709\u6b7b\u9501\uff1b\u5426\u5219\uff0c\u5269\u4f59\u7684\u6240\u6709unmarked\u8fdb\u7a0b\u6784\u6210\u4e86\u6b7b\u9501<\/div>\n<p><audio style=\"display: none;\" controls=\"controls\"><\/audio><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MOS: Modern Operating Systems deadlock detection with one resource of each type \u5982\u679c\u6bcf\u79cd\u8d44\u6e90\u90fd\u662f\u72ec\u4e00\u4efd\u7684\uff0c\u53ef\u4ee5\u7528\u4e0a\u9762\u8fd9\u6837\u7684\u56fe\u6765\u5206\u6790\u8d44\u6e90\u7ade\u4e89\u60c5\u51b5\u3002 \u56fe\u4e2d\u65b9\u5757\u4ee3\u8868\u8d44\u6e90\uff0c\u5706\u5f62\u4ee3\u8868\u8fdb\u7a0b\uff1b\u6307\u5411\u8fdb\u7a0b\u7684\u7bad\u5934\u8868\u793a\u8d44\u6e90\u88ab\u8be5\u8fdb\u7a0b\u62e5\u6709\uff0c\u800c\u4ece\u8fdb\u7a0b\u51fa\u53d1\u7684\u7bad\u5934\u8868\u793a\u5176\u9700\u8981\u7684\u8d44\u6e90\u3002 \u6709\u5411\u56fe\u4e2d\u53ea\u8981\u5b58\u5728\u4e00\u4e2a\u95ed\u73af\uff0c\u5c31\u5b58\u5728\u4e00\u4e2a\u6b7b\u9501 \u627e\u51fa\u95ed\u73af\u7684\u65b9\u6cd5\u6709\u5f88\u591a\u79cd\uff0c\u8fd9\u91cc\u7ed9\u51fa\u4e00\u4e2a\u6bd4\u8f83\u76f4\u89c2\u7684\u65b9\u6cd5\uff1a 0\uff09\u9996\u5148\u628a\u56fe\u4e2d\u6240\u6709\u7bad\u5934\u8bb0\u4e3aunmarked\uff0c\u521d\u59cb\u5316\u4e00\u4e2a\u7a7a\u94fe\u8868L\uff0c\u5e76\u9009\u4e2d\u4e00\u4e2a\u8282\u70b9\uff08\u65e0\u8bba\u662f\u8fdb\u7a0b\u8fd8\u662f\u8d44\u6e90\uff0c\u8fd9\u91cc\u53ea\u8003\u8651\u62bd\u8c61\u51fa\u7684\u6709\u5411\u56fe\uff09\u4e3a\u5f53\u524d\u8282\u70b9 1\uff09\u5224\u65ad\u8be5\u8282\u6709\u6ca1\u6709\u51fa\u73b0\u5728L\u4e2d\uff0c\u5982\u679c\u6ca1\u6709\u5219\u52a0\u5165L\u5c3e\u90e8\u8fdb\u5165\u4e0b\u4e00\u6b65\uff1b\u5982\u679c\u6709\u5219\u8bf4\u660e\u5b58\u5728\u4e00\u4e2a\u95ed\u73af\uff0c\u5373\u53d1\u73b0\u6b7b\u9501 2\uff09\u5f53\u524d\u8282\u70b9\u5982\u679c\u6709\u5411\u5916\u7684unmarked\u7bad\u5934\u5c31\u987a\u7740\u5b83\u627e\u5230\u4e0b\u4e00\u4e2a\u8282\u70b9\uff0c\u540c\u65f6\u5c06\u8be5\u7bad\u5934\u6807\u8bb0\u4e3amarked\uff0c\u8df3\u52301\uff09\uff1b\u5982\u679c\u6ca1\u6709unmarked\u7bad\u5934\u8fdb\u5165\u4e0b\u4e00\u6b65 3\uff09\u6ca1\u6709unmarked\u7684\u7bad\u5934\u8868\u660e\u5df2\u7ecf\u8fdb\u5165\u6b7b\u80e1\u540c\uff0c\u5220\u6389\u5f53\u524d\u8282\u70b9\uff0c\u56de\u6eaf\u5230\u6e90\u8282\u70b9\uff0c\u5c06\u5176\u8bbe\u7f6e\u4e3a\u5f53\u524d\u8282\u70b9\uff0c\u8df3\u52302\uff09 deadlock detection with multiple resources of each type \u5f53\u4e00\u79cd\u8d44\u6e90\u6709\u591a\u4e2a\u53ef\u7528\u5b9e\u4f53\u65f6\uff0c\u6211\u4eec\u4f7f\u7528\u4e00\u79cd\u57fa\u4e8e\u77e9\u9635\u7684\u7b97\u6cd5 \u5411\u91cfE\u8868\u793am\u79cd\u8d44\u6e90\u76ee\u524d\u88ab\u5360\u7528\u7684\u60c5\u51b5\uff0cA\u8868\u793am\u79cd\u8d44\u6e90\u5269\u4f59\u91cf \u77e9\u9635C\u8868\u793an\u4e2a\u8fdb\u7a0b\u76ee\u524d\u5206\u522b\u5360\u7528\u5404\u79cd\u8d44\u6e90\u7684\u60c5\u51b5\uff0c\u6bcf\u884c\u4ee3\u8868\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u6bcf\u5217\u662f\u4e00\u79cd\u8d44\u6e90\u5bf9\u5e94\u7684\u5404\u4e2a\u8fdb\u7a0b\u5360\u7528\u60c5\u51b5\uff0cm\u5217\u6c42\u548c\u5c31\u7b49\u4e8eEm \u77e9\u9635R\u8868\u793an\u4e2a\u8fdb\u7a0b\u76ee\u524d\u5bf9\u5404\u79cd\u8d44\u6e90\u7684\u9700\u6c42\u91cf\uff0c\u884c\u5217\u610f\u4e49\u540c\u4e0a \u5b9a\u4e49\u5411\u91cfX&lt;=Y\u5f53\u4e14\u4ec5\u5f53X\u7684\u6bcf\u4e2a\u5206\u91cf\u90fd&lt;=Y\u7684\u5bf9\u5e94\u5206\u91cf \u7b97\u6cd5\u6b65\u9aa4\uff1a 0\uff09\u6240\u6709\u8fdb\u7a0b\u6807\u8bb0\u4e3aunmarked 1\uff09\u627e\u5230\u4e00\u4e2aunmarked\u8fdb\u7a0bi\uff0c\u5176\u5360\u7528\u7684\u8d44\u6e90Ri&lt;=A\uff0c\u4e0b\u4e00\u6b65\uff1b\u6ca1\u6709\u6ee1\u8db3\u8be5\u6761\u4ef6\u7684\u8fdb\u7a0b\uff0c\u8df3\u52303\uff09 2\uff09A=A+Ci\uff0c\u8fdb\u7a0bi\u6807\u8bb0\u4e3amarked\uff0c\u8df3\u52301\uff09 3\uff09\u5982\u679c\u6240\u6709\u8fdb\u7a0b\u90fd\u662fmarked\uff0c\u8868\u793a\u90fd\u5f97\u5230\u4e86\u6267\u884c\uff0c\u6ca1\u6709\u6b7b\u9501\uff1b\u5426\u5219\uff0c\u5269\u4f59\u7684\u6240\u6709unmarked\u8fdb\u7a0b\u6784\u6210\u4e86\u6b7b\u9501<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"footnotes":"","_jetpack_memberships_contains_paid_content":false,"jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[3],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7Dhki-2E","jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/www.luo666.com\/index.php?rest_route=\/wp\/v2\/posts\/164"}],"collection":[{"href":"http:\/\/www.luo666.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.luo666.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.luo666.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.luo666.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=164"}],"version-history":[{"count":4,"href":"http:\/\/www.luo666.com\/index.php?rest_route=\/wp\/v2\/posts\/164\/revisions"}],"predecessor-version":[{"id":273,"href":"http:\/\/www.luo666.com\/index.php?rest_route=\/wp\/v2\/posts\/164\/revisions\/273"}],"wp:attachment":[{"href":"http:\/\/www.luo666.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=164"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.luo666.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=164"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.luo666.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}