Dydaktyka
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Ćwiczenia 11, grupa cz. 12-14, 26. maja 2022 ###### tags: `SYK21` `ćwiczenia` `pwit` > ## Deklaracje Gotowość rozwiązania zadania należy wyrazić poprzez postawienie X w odpowiedniej kolumnie! Jeśli pożądasz zreferować dane zadanie (co najwyżej jedno!) w trakcie dyskusji oznacz je znakiem ==X== na żółtym tle. **UWAGA: Tabelkę wolno edytować tylko wtedy, gdy jest na zielonym tle!** :::danger | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | | ----------------------:| ----- | --- | --- | --- | --- | --- | --- | --- | --- | Daniel Boguszewski | x | x | x | x | x | x | x | x | | Adam Ciężkowski | | | | | | | | | | Jacek Długopolski | x | x | x | x | | | x | x | x | Jakub Fila | x | x | x | | | x | x | x | x | Krzysztof Grynkiewicz | | | | | | | | | | Michał Hetnar | x | x | | | | | | | | Hubert Jabłoński | x | x | x | x |==x==| x | x | x | x | Antoni Kamiński | | | | | | | | | | Paweł Karaś | X | ==X== | X | X | X | X | X | X | X | Emil Kisielewicz | x | x | x | x | x | | x | | | Kacper Komenda | x | x | x | x | x | x | x |==x==| x | Filip Komorowski | x | x | x | x | x | x | x | x | | Piotr Piesiak | x | x | x | x | x | x | x | x | x | Artur Krzyżyński | x | x | x | x | x | x | x | x | ==x== | Patryk Mazur | X | X | ==X== | X | | X | X | | | Szymon Mleczko | x | x | x | x | x | x | x | x | | Michał Mróz | X | X | X | | | | | | | Dominik Olejarz | ==x== | x | x | x | x | x | x | x | x | Magdalena Słonińska | X | X |==X==| X | | X | X | | | Oleś Kulczewicz | X | X | X | X | | | | | | Adam Szeruda | X | X | X | X | X | X | X | X | X | Kamil Tasarz | X | X | X | X | | | X | | | Michał Zieliński | ==X== | X | X | X | X | X | X | X | X | ::: Lista 10, zadanie 9: - Adam Szeruda - Piotr Piesiak - Jacek Długopolski :::info **Uwaga:** Po rozwiązaniu zadania należy zmienić kolor nagłówka na zielony. ::: ## Zadanie 1 :::success Autor: Dominik Olejarz ::: ![](https://i.imgur.com/pKL6RHL.png) *proces ograniczony przez dostęp do procesora-proces który potrzebuje byc przez dlugi czas wykonywany *proces ograniczony przez wejście-wyjście - proces który potrzebuje interakcji z urządzeniami zewnetrznymi *proces interaktywny - proces który potrzebuje interakcji z użytkownikiem (np klikniecie przycisku) *program wsadowy - wykonywany w trybie wsadowym, bez wpływu użytkownika na przebieg programu ## Zadanie 2 :::success Autor: Paweł Karaś ::: ![](https://i.imgur.com/jF7OdAK.png) ### Miary efektywności algorytmów - **CPU Utilization** Utrzymywanie procesora zajętego - **Throughput** Liczba procesów które się zakończą na daną jednostkę czasu - **Turnaround time** Średni czas na wykonanie danego procesu - **Waiting time** Średni czas jaki proces musiał czekać w ready queue - **Response Time** Czas jaki zajął systemowi od czasu rządania procesu do czasu pierwszej odpowiedzi | Algorytm | Optymalizuje | | --------------------------- | -------------------------------------------- | | FCFS | CPU Utilization | | SJF | CPU Utilization, Throughput, Turnaround time | | SRT | Throughput, Turnaround time | | Round Robin | Response Time | | Priority Queue (preemptive) | Response Time | ## Zadanie 3 :::success Autor: Patryk Mazur ::: ![](https://i.imgur.com/rMgkV2F.png) :::spoiler First-Come, First-Served FCFS ![](https://i.imgur.com/XTDVnXP.png) ### Czas cyklu przetworzenia (Turnaround time) $P1 = 2$ $P2 = 3$ $P3 = 11$ $P4 = 15$ $P5 = 20$ ### Czas oczekiwania dla każdego procesu (Waiting time) $P1 = 0$ $P2 = 2$ $P3 = 3$ $P4 = 11$ $P5 = 15$ ### Średni czas oczekiwania $(0+2+3+11+15) / 5 = 6.2$ ::: :::spoiler Shortest-Job-First SJF ![](https://i.imgur.com/idNCVKQ.png) ### Czas cyklu przetworzenia (Turnaround time) $P1 = 3$ $P2 = 1$ $P3 = 20$ $P4 = 7$ $P5 = 12$ ### Czas oczekiwania dla każdego procesu (Waiting time) $P1 = 1$ $P2 = 0$ $P3 = 12$ $P4 = 3$ $P5 = 7$ ### Średni czas oczekiwania $(1+0+12+3+7) / 5 = 4.6$ ::: :::spoiler Priorytetowy bez wywłaszczeń ![](https://i.imgur.com/gdjtTB9.png) ### Czas cyklu przetworzenia (Turnaround time) $P1 = 15$ $P2 = 20$ $P3 = 8$ $P4 = 19$ $P5 = 13$ ### Czas oczekiwania dla każdego procesu (Waiting time) $P1 = 13$ $P2 = 19$ $P3 = 0$ $P4 = 15$ $P5 = 8$ ### Średni czas oczekiwania $(13+19+0+15+8) / 5 = 11$ ::: :::spoiler Round-Robin ![](https://i.imgur.com/HxSCtZh.png) ### Czas cyklu przetworzenia (Turnaround time) $P1 = 2$ $P2 = 3$ $P3 = 20$ $P4 = 13$ $P5 = 18$ ### Czas oczekiwania dla każdego procesu (Waiting time) $P1 = 0$ $P2 = 2$ $P3 = 3+4+4+1=12$ $P4 = 5+4=9$ $P5 = 7+4+2=13$ ### Średni czas oczekiwania $(0+2+12+9+13) / 5 = 7.2$ ::: ## Zadanie 4 :::success Autor: Jacek Długopolski ::: ![](https://i.imgur.com/4Z6jeX7.jpg) ![](https://i.imgur.com/2AHrl94.jpg) ## Zadanie 5 :::success Autor: Hubert Jabłoński ::: ![](https://i.imgur.com/2atYLe8.png) | P | Burst time | I/O burst | |-----|------------|-----------| |$P_1$| 10 | 3 | |$P_2$| 8 | - | $Q = 4$ $|P_1 P_1 P_1|P_2 P_2 P_2 P_2|P_1|P_2 P_2 P_2 P_2|P_1 P_1 P_1|P_1|P_1 P_1 P_1|P_1|P_1|$ Karanie procesów czekające na sygnały wejścia/wyjścia Faworyzowanie wszystkich innych procesów ## Zadanie 6 :::success Autor: Filip Komorowski ::: ![](https://i.imgur.com/cOtjzGk.png) * SJF ![](https://i.imgur.com/5yX69k5.png) * Wykładnicze uśrednianie ![](https://i.imgur.com/urLksJm.png) * SRT ![](https://i.imgur.com/N5evWGX.png) a) $\alpha = 0 \space i \space \tau_{0} = 100$ milisekund W tym przypadku widzimy, że poprzednie czasy rzeczywiste nie są w żaden sposób uwzględniane i bierzemy cały czas początkową predykcję. b) $\alpha = 0.99 \space i \space \tau_{0} = 10$ milisekund W tym przypadku z kolei poprzednie predykcje mają marginalne znaczenie i predykcja następnego czasu będzie równa mniej więcej poprzedniemu czasowi wykonania. ## Zadanie 7 :::success Autor: Adam Szeruda ::: > Zdefiniuj algorytm planowania procesów z użyciem wielopoziomowych kolejek ze sprzężeniem zwrotnym (ang. multilevel feedback queues). W jaki sposób taki algorytm obsługuje różne klasy procesów (interaktywne, czasu rzeczywistego, wsadowe)? Czemu służą reguły promocji i degradacji procesów pomiędzy kolejkami? Wilopoziomowa kolejka ze sprzężeniem zwrotnym: - składa się z $n$ składowych kolejek, każda ma swój algorytm planowania - ustalona metoda degradacji i promocji procesu na późniejszą/wcześniejszą kolejkę - ustalona metoda wyboru kolejki dla procesu Obsługa procesów interaktywnych, czasu rzeczywistego, wsadowych - każdemu procesowi przydzielana jest początkowa kolejka - procesom czasu rzeczywistego jedna z początkowych kolejek, procesow wsadowym jedna z końcowych. Reguła promocji - metoda zapobiegania starzeniu się procesów - proces o długim czasie oczekiwania zostaje promowany do wcześniejszej kolejki. ## Zadanie 8 :::success Autor: Kacper Komenda ::: Klasyczny algorytm UNIX wykorzystuje wiele karuzel RR dla różnych poziomów priorytetów. Kolejki podzielone są na kolejki jądra i kolejki użytkownika, nie mogą przeskakiwać między sobą. Priorytety kernela są zakodowane, by np. czekanie na dysk było wyżej niż czekanie na bufor. Procesy nie mogą przeskoczyć ze strefy użytkownika na tę kernelu. Przy powrocie z kernelu system oblicza priorytety powracających procesów. W trakcie działania priorytety użytkownika mogą przeskakiwać pomiędzy poszczególnymi levelami. Kernel dynamicznie oblicza priorytet stosując do tego priorytet zadany przez użytkownika i czas dostępu do procesora. Co jakiś czas dodawany jest czas procesora. Rekalkulowane jest to co mniej więcej sekundę, wtedy zgromadzony czas procesora dzielony jest na 2. Aby obliczyć aktualny priorytet dzieli się obecnie zgromadzony czas procesora na 2 i do tego dodaje się priorytet zlecony przez użytkownika. Dodatkowo istnieje jeszcze zmienna "nice", która jest dodawana do obliczanego priorytetu. Jednak tylko superużytkownik może dodać do tego obliczonego priorytetu wartość, która zwiększy priorytet. ![](https://i.imgur.com/43Gs2An.png) ![](https://i.imgur.com/OzU5SFN.png) ![](https://i.imgur.com/LQWtU7H.png) ![](https://i.imgur.com/MsD19Gw.png) ![](https://i.imgur.com/0wyjP9a.png) ## Zadanie 9 :::success Autor: Artur Krzyżyński ::: :::info Zadanie 9. Zaprezentuj algorytm planowania ze sprawiedliwym podziałem (ang. fair share scheduler), będący wariantem algorytmu z poprzedniego zadania. Wskazówka: Przeczytaj podrozdział 8.1.5 książki wymienionej we wskazówce do zadania 8. ::: Tak jak w zadaniu 8 tylko dodajemy GROUP/const priority = 'base priority' + CPU/const + 'nice value' + GROUP/const decay(GROUP) = GROUP/2 Przykład: A - grupa 1 B, C - grupa 2 ABACABAC.. grupa 1 - 50% grupa 2 - 50% (po 25% na B, C) ![](https://i.imgur.com/Z2iWRTN.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully