This commit is contained in:
ridethepig 2023-04-05 22:39:03 +08:00
parent 8e66657fe8
commit abe668700c
3 changed files with 598 additions and 2 deletions

View File

@ -434,5 +434,475 @@
:height 1296}),
:page 56},
:content {:text " KEY PROCESS TERMS"},
:properties {:color "yellow"}}
{:id #uuid "642cc7d2-cd33-4dd6-879f-72f1070ed96d",
:page 60,
:position {:bounding {:x1 404.16966247558594,
:y1 343.8303680419922,
:x2 691.9583587646484,
:y2 381.54466247558594,
:width 864,
:height 1296},
:rects ({:x1 404.16966247558594,
:y1 343.8303680419922,
:x2 691.9583587646484,
:y2 381.54466247558594,
:width 864,
:height 1296}),
:page 60},
:content {:text "Interlude: Process API"},
:properties {:color "yellow"}}
{:id #uuid "642cc975-cf26-431c-8c38-617da01d89ee",
:page 65,
:position {:bounding {:x1 0,
:y1 46.28571605682373,
:x2 746.3800811767578,
:y2 272.88393688201904,
:width 864,
:height 1296},
:rects ({:x1 0,
:y1 46.28571605682373,
:x2 0,
:y2 65.71428966522217,
:width 864,
:height 1296}
{:x1 301.4553680419922,
:y1 233.58928966522217,
:x2 393.60862731933594,
:y2 257.01787853240967,
:width 864,
:height 1296}
{:x1 393.5982208251953,
:y1 235.25001049041748,
:x2 746.3800811767578,
:y2 253.17858409881592,
:width 864,
:height 1296}
{:x1 171.8928680419922,
:y1 255.1696424484253,
:x2 367.95936584472656,
:y2 272.88393688201904,
:width 864,
:height 1296}),
:page 65},
:content {:text "Get it right. Neither abstraction nor simplicity is a substitute for getting it righ"},
:properties {:color "yellow"}}
{:id #uuid "642ccc92-baa5-4b54-8525-9a664698c669",
:page 65,
:position {:bounding {:x1 0,
:y1 334.2857208251953,
:x2 747.6986846923828,
:y2 766.8035888671875,
:width 864,
:height 1296},
:rects ({:x1 0,
:y1 334.2857208251953,
:x2 0,
:y2 353.71429443359375,
:width 864,
:height 1296}
{:x1 0,
:y1 350.2857208251953,
:x2 0,
:y2 369.7142868041992,
:width 864,
:height 1296}
{:x1 0,
:y1 366.2857208251953,
:x2 0,
:y2 385.7142868041992,
:width 864,
:height 1296}
{:x1 419.60740661621094,
:y1 689.3303680419922,
:x2 747.6986846923828,
:y2 707.2589416503906,
:width 864,
:height 1296}
{:x1 171.8928680419922,
:y1 709.2589416503906,
:x2 747.6194000244141,
:y2 727.1875152587891,
:width 864,
:height 1296}
{:x1 171.8928680419922,
:y1 729.1696624755859,
:x2 747.0166168212891,
:y2 747.0982360839844,
:width 864,
:height 1296}
{:x1 171.8928680419922,
:y1 749.0893096923828,
:x2 532.4863128662109,
:y2 766.8035888671875,
:width 864,
:height 1296}),
:page 65},
:content {:text "the separation of fork() and exec() is essential in building a UNIX shell, because it lets the shell run code after the call to fork() but before the call to exec(); this code can alter the environment of the about-to-be-run program, "},
:properties {:color "yellow"}}
{:id #uuid "642ccf62-0b5a-41db-899e-3e99a69c2eac",
:page 67,
:position {:bounding {:x1 500.46167755126953,
:y1 898.3482360839844,
:x2 588.625373840332,
:y2 916.0625305175781,
:width 864,
:height 1296},
:rects ({:x1 500.46167755126953,
:y1 898.3482360839844,
:x2 588.625373840332,
:y2 916.0625305175781,
:width 864,
:height 1296}),
:page 67},
:content {:text "imperatives"},
:properties {:color "green"}}
{:id #uuid "642cd11a-eea5-48f8-b4d1-b225f37ccdb4",
:page 67,
:position {:bounding {:x1 315.2972640991211,
:y1 938.2054138183594,
:x2 363.1093215942383,
:y2 955.919677734375,
:width 864,
:height 1296},
:rects ({:x1 315.2972640991211,
:y1 938.2054138183594,
:x2 363.1093215942383,
:y2 955.919677734375,
:width 864,
:height 1296}),
:page 67},
:content {:text " signa"},
:properties {:color "yellow"}}
{:id #uuid "642cd1eb-c058-484a-ac25-782e37082bc6",
:page 74,
:position {:bounding {:x1 285.3382987976074,
:y1 938.2500305175781,
:x2 524.2904014587402,
:y2 959.9642944335938,
:width 864,
:height 1296},
:rects ({:x1 285.3382987976074,
:y1 938.2500305175781,
:x2 524.2904014587402,
:y2 959.9642944335938,
:width 864,
:height 1296}),
:page 74},
:content {:text "Limited Direct Execution"},
:properties {:color "yellow"}}
{:id #uuid "642cd2f2-c565-4309-951a-1f809da9beff",
:page 75,
:position {:bounding {:x1 171.8928680419922,
:y1 775.9822082519531,
:x2 236.6775360107422,
:y2 793.6964416503906,
:width 864,
:height 1296},
:rects ({:x1 171.8928680419922,
:y1 775.9822082519531,
:x2 236.6775360107422,
:y2 793.6964416503906,
:width 864,
:height 1296}),
:page 75},
:content {:text "aspiring"},
:properties {:color "green"}}
{:id #uuid "642cd3e3-3fa6-43a6-a37a-cae62c634654",
:page 76,
:position {:bounding {:x1 197.56250381469727,
:y1 792.107177734375,
:x2 282.93234634399414,
:y2 815.5357360839844,
:width 864,
:height 1296},
:rects ({:x1 197.56250381469727,
:y1 792.107177734375,
:x2 282.93234634399414,
:y2 815.5357360839844,
:width 864,
:height 1296}),
:page 76},
:content {:text "user mode"},
:properties {:color "yellow"}}
{:id #uuid "642cd6be-083b-4ecd-b220-aafef97a8b65",
:page 78,
:position {:bounding {:x1 309.4553680419922,
:y1 972.6250610351562,
:x2 586.8960418701172,
:y2 996.0536193847656,
:width 864,
:height 1296},
:rects ({:x1 309.4553680419922,
:y1 972.6250610351562,
:x2 586.8960418701172,
:y2 996.0536193847656,
:width 864,
:height 1296}),
:page 78},
:content {:text "Limited Direct Execution Protocol"},
:properties {:color "yellow"}}
{:id #uuid "642cd6e9-21fc-49c7-b0bb-0c9ba3b7a524",
:page 79,
:position {:bounding {:x1 313.4107360839844,
:y1 195.0178680419922,
:x2 363.1207580566406,
:y2 212.9464340209961,
:width 864,
:height 1296},
:rects ({:x1 313.4107360839844,
:y1 195.0178680419922,
:x2 363.1207580566406,
:y2 212.9464340209961,
:width 864,
:height 1296}),
:page 79},
:content {:text "WARY"},
:properties {:color "green"}}
{:id #uuid "642cd90e-ab6b-4d4d-8312-cd8c69efdac8",
:page 80,
:position {:bounding {:x1 240.1057357788086,
:y1 411.30360412597656,
:x2 519.1290512084961,
:y2 433.0178909301758,
:width 864,
:height 1296},
:rects ({:x1 240.1057357788086,
:y1 411.30360412597656,
:x2 519.1290512084961,
:y2 433.0178909301758,
:width 864,
:height 1296}),
:page 80},
:content {:text "Switching Between Processes"},
:properties {:color "yellow"}}
{:id #uuid "642cdc2e-329c-423e-a65a-0a53fb6eaa76",
:page 81,
:position {:bounding {:x1 336.91209411621094,
:y1 1022.8215026855469,
:x2 423.3618927001953,
:y2 1040.5357818603516,
:width 864,
:height 1296},
:rects ({:x1 336.91209411621094,
:y1 1022.8215026855469,
:x2 423.3618927001953,
:y2 1040.5357818603516,
:width 864,
:height 1296}),
:page 81},
:content {:text "malfeasance"},
:properties {:color "green"}}
{:id #uuid "642ce319-8087-4252-b51d-42f749f7c283",
:page 83,
:position {:bounding {:x1 241.65673828125,
:y1 254.54465866088867,
:x2 288.17628479003906,
:y2 272.25893783569336,
:width 864,
:height 1296},
:rects ({:x1 241.65673828125,
:y1 254.54465866088867,
:x2 288.17628479003906,
:y2 272.25893783569336,
:width 864,
:height 1296}),
:page 83},
:content {:text "coff a"},
:properties {:color "green"}}
{:id #uuid "642ce357-9914-417b-8036-35ae44ac7283",
:page 83,
:position {:bounding {:x1 537.6926574707031,
:y1 462.4286003112793,
:x2 579.2625122070312,
:y2 480.1428642272949,
:width 864,
:height 1296},
:rects ({:x1 537.6926574707031,
:y1 462.4286003112793,
:x2 579.2625122070312,
:y2 480.1428642272949,
:width 864,
:height 1296}),
:page 83},
:content {:text " enac"},
:properties {:color "green"}}
{:id #uuid "642cef47-0c2f-482f-8b61-9a715e5438e5",
:page 84,
:position {:bounding {:x1 164.6323013305664,
:y1 1059.1072082519531,
:x2 205.6727066040039,
:y2 1076.8215026855469,
:width 864,
:height 1296},
:rects ({:x1 164.6323013305664,
:y1 1059.1072082519531,
:x2 205.6727066040039,
:y2 1076.8215026855469,
:width 864,
:height 1296}),
:page 84},
:content {:text "whet "},
:properties {:color "green"}}
{:id #uuid "642cf0c1-59a2-410e-8f45-517f66ef47f9",
:page 86,
:position {:bounding {:x1 187.13980865478516,
:y1 734.4018096923828,
:x2 265.6998596191406,
:y2 752.1161041259766,
:width 864,
:height 1296},
:rects ({:x1 187.13980865478516,
:y1 734.4018096923828,
:x2 265.6998596191406,
:y2 752.1161041259766,
:width 864,
:height 1296}),
:page 86},
:content {:text "analogous "},
:properties {:color "green"}}
{:id #uuid "642cf292-4464-4c8f-8639-3a194484d4c0",
:page 90,
:position {:bounding {:x1 173.84801483154297,
:y1 1038.8928833007812,
:x2 359.95592498779297,
:y2 1056.607177734375,
:width 864,
:height 1296},
:rects ({:x1 173.84801483154297,
:y1 1038.8928833007812,
:x2 359.95592498779297,
:y2 1056.607177734375,
:width 864,
:height 1296}),
:page 90},
:content {:text "workload assumptions w"},
:properties {:color "yellow"}}
{:id #uuid "642cf48d-b312-4af1-a2ff-d55cf9f32e48",
:page 91,
:position {:bounding {:x1 0,
:y1 270.2857208251953,
:x2 747.7616271972656,
:y2 625.1696624755859,
:width 864,
:height 1296},
:rects ({:x1 0,
:y1 270.2857208251953,
:x2 0,
:y2 289.71429443359375,
:width 864,
:height 1296}
{:x1 615.4732360839844,
:y1 581.8125305175781,
:x2 747.7616271972656,
:y2 605.2410888671875,
:width 864,
:height 1296}
{:x1 615.4472351074219,
:y1 583.4732360839844,
:x2 747.7616271972656,
:y2 601.1875305175781,
:width 864,
:height 1296}
{:x1 171.8928680419922,
:y1 601.7410888671875,
:x2 192.8222198486328,
:y2 625.1696624755859,
:width 864,
:height 1296}),
:page 91},
:content {:text "scheduling metric"},
:properties {:color "yellow"}}
{:id #uuid "642cf4c4-d246-48f2-a6ef-f14c77684ad9",
:page 91,
:position {:bounding {:x1 551.5064392089844,
:y1 929.8125,
:x2 635.8687438964844,
:y2 947.5267944335938,
:width 864,
:height 1296},
:rects ({:x1 551.5064392089844,
:y1 929.8125,
:x2 635.8687438964844,
:y2 947.5267944335938,
:width 864,
:height 1296}),
:page 91},
:content {:text "conundrum "},
:properties {:color "green"}}
{:id #uuid "642cf4f9-4afd-4240-ac76-5522285fa1eb",
:page 91,
:position {:bounding {:x1 0,
:y1 574.2857666015625,
:x2 747.7544326782227,
:y2 1081.6161346435547,
:width 864,
:height 1296},
:rects ({:x1 0,
:y1 574.2857666015625,
:x2 0,
:y2 593.7143249511719,
:width 864,
:height 1296}
{:x1 643.7589492797852,
:y1 1038.2589950561523,
:x2 747.7544326782227,
:y2 1061.6875686645508,
:width 864,
:height 1296}
{:x1 643.7497329711914,
:y1 1039.9197082519531,
:x2 747.7544326782227,
:y2 1057.6339950561523,
:width 864,
:height 1296}
{:x1 171.8928680419922,
:y1 1058.1875686645508,
:x2 258.0138168334961,
:y2 1081.6161346435547,
:width 864,
:height 1296}
{:x1 171.8928680419922,
:y1 1061.0447082519531,
:x2 266.54952239990234,
:y2 1078.9732818603516,
:width 864,
:height 1296}),
:page 91},
:content {:text "First In, First Out (FIFO)"},
:properties {:color "yellow"}}
{:id #uuid "642cf705-4a47-4daa-a542-43c4ae6f239e",
:page 93,
:position {:bounding {:x1 171.8928680419922,
:y1 570.7500419616699,
:x2 333.2419891357422,
:y2 592.4643363952637,
:width 864,
:height 1296},
:rects ({:x1 171.8928680419922,
:y1 570.7500419616699,
:x2 333.2419891357422,
:y2 592.4643363952637,
:width 864,
:height 1296}),
:page 93},
:content {:text "Shortest Job First"},
:properties {:color "yellow"}}
{:id #uuid "642cfce4-67f5-4315-bf81-445922b8ae54",
:page 94,
:position {:bounding {:x1 116.09822082519531,
:y1 998.1607666015625,
:x2 518.0627288818359,
:y2 1019.8750610351562,
:width 864,
:height 1296},
:rects ({:x1 116.09822082519531,
:y1 998.1607666015625,
:x2 518.0627288818359,
:y2 1019.8750610351562,
:width 864,
:height 1296}),
:page 94},
:content {:text "Shortest Time-to-Completion First (STCF)"},
:properties {:color "yellow"}}],
:extra {:page 65}}
:extra {:page 95}}

2
journals/2023_04_05.md Normal file
View File

@ -0,0 +1,2 @@
-
-

View File

@ -95,3 +95,127 @@ file-path:: ../assets/ostep_1680491762166_0.pdf
hl-page:: 56
hl-color:: yellow
id:: 642c27e3-d7d6-41d8-9832-73674615a246
- Interlude: Process API
hl-page:: 60
ls-type:: annotation
id:: 642cc7d2-cd33-4dd6-879f-72f1070ed96d
hl-color:: yellow
Syscall-fork, wait, exec
- Get it right. Neither abstraction nor simplicity is a substitute for getting it right
ls-type:: annotation
hl-page:: 65
hl-color:: yellow
id:: 642cc975-cf26-431c-8c38-617da01d89ee
- the separation of fork() and exec() is essential in shell, because it lets the shell <u>run code after the call to fork() but before the call to exec()</u>; this code can alter the environment of the about-to-be-run program
hl-page:: 65
ls-type:: annotation
id:: 642ccc92-baa5-4b54-8525-9a664698c669
hl-color:: yellow
- imperative 必要的,命令的;必要的事
hl-page:: 67
ls-type:: annotation
id:: 642ccf62-0b5a-41db-899e-3e99a69c2eac
hl-color:: green
- control processes through signal subsystem
hl-page:: 67
ls-type:: annotation
id:: 642cd11a-eea5-48f8-b4d1-b225f37ccdb4
hl-color:: yellow
- Limited Direct Execution: Direct execution is to simply run the program directly on the CPU.
hl-page:: 74
ls-type:: annotation
id:: 642cd1eb-c058-484a-ac25-782e37082bc6
hl-color:: yellow
- aspiring 有追求的,有抱负的
hl-page:: 75
ls-type:: annotation
id:: 642cd2f2-c565-4309-951a-1f809da9beff
hl-color:: green
- user mode and kernel mode
hl-page:: 76
ls-type:: annotation
id:: 642cd3e3-3fa6-43a6-a37a-cae62c634654
hl-color:: yellow
- In user mode, code is restricted in what it can do, otherwise the processor will raise an exception
- User code perform system call to do privileged operation.
- To execute a system call, use `trap` and `return-from-trap` instruction: jump to/from kernel and change the privilege level.
-
- Limited Direct Execution Protocol-interesting figure illustrating how system call is done
hl-page:: 78
ls-type:: annotation
id:: 642cd6be-083b-4ecd-b220-aafef97a8b65
hl-color:: yellow
- wary 谨慎的;考虑周到的
hl-page:: 79
ls-type:: annotation
id:: 642cd6e9-21fc-49c7-b0bb-0c9ba3b7a524
hl-color:: green
- Switching Between Processes: how OS regain control of the CPU
hl-page:: 80
ls-type:: annotation
id:: 642cd90e-ab6b-4d4d-8312-cd8c69efdac8
hl-color:: yellow
- Cooperative Approach: wait for a system call. 1. The processes are expected to give up the CPU periodically through system call `yield`(which does nothing except to transfer control to the OS). 2. The process does something that causes a trap
- Non-Cooperative Approach: timer interrupt.
- Context switch: save a few register values for the currently-executing process.
Two types of register saves/restores: TI, hardware save state to kernel stack; context switch, OS save kernel registers and restore everything to return from trap
- malfeasance 渎职;不正当行为
hl-page:: 81
ls-type:: annotation
id:: 642cdc2e-329c-423e-a65a-0a53fb6eaa76
hl-color:: green
- scoff
hl-page:: 83
ls-type:: annotation
id:: 642ce319-8087-4252-b51d-42f749f7c283
hl-color:: green
- enact
ls-type:: annotation
hl-page:: 83
hl-color:: green
id:: 642ce357-9914-417b-8036-35ae44ac7283
- whet
ls-type:: annotation
hl-page:: 84
hl-color:: green
id:: 642cef47-0c2f-482f-8b61-9a715e5438e5
- analogous
ls-type:: annotation
hl-page:: 86
hl-color:: green
id:: 642cf0c1-59a2-410e-8f45-517f66ef47f9
- workload assumptions: Each job, runs for the same amount of time, arrives at the same time, runs to completion, uses only CPU, and run-time is known
hl-page:: 90
ls-type:: annotation
id:: 642cf292-4464-4c8f-8639-3a194484d4c0
hl-color:: yellow
- Quite unrealistic, but modern preemptive scheduling somewhat mimics part of these assumptions
- scheduling metric: turnaround time, aka `completion - arrival`
hl-page:: 91
ls-type:: annotation
id:: 642cf48d-b312-4af1-a2ff-d55cf9f32e48
hl-color:: yellow
- conundrum
ls-type:: annotation
hl-page:: 91
hl-color:: green
id:: 642cf4c4-d246-48f2-a6ef-f14c77684ad9
- First In, First Out (FIFO/FCFS) algorithm
hl-page:: 91
ls-type:: annotation
id:: 642cf4f9-4afd-4240-ac76-5522285fa1eb
hl-color:: yellow
- Bad average turnaround when long job runs first
- Convoy effect: a number of relatively-short potential consumers of a resource get queued behind a heavyweight resource consumer
- Shortest Job First(SJF)
hl-page:: 93
ls-type:: annotation
id:: 642cf705-4a47-4daa-a542-43c4ae6f239e
hl-color:: yellow
- assuming that jobs all arriving at the same time, it could be proven that SJF is indeed an optimal scheduling algorithm
- Downgrade to the same problem of Convey Effect when jobs don't arrive at the same time. For example, short jobs arrive shortly after the long job.
- Shortest Time-to-Completion First (STCF)
ls-type:: annotation
hl-page:: 94
hl-color:: yellow
id:: 642cfce4-67f5-4315-bf81-445922b8ae54