Wonbi
    • Create new note
    • Create a note from template
      • 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
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me 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
    • Save as template
    • 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 Create Help
Create Create new note Create a note from template
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
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me 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
    #### 🛠 Concurrency Programming - 동시성(Concurrency) 프로그래밍, 병렬(Parallelism) 프로그래밍은 어떻게 다르며, 우리가 주로 접할 iOS 환경에서는 무엇을 더 고려해봐야 할까? ![](https://nesoy.github.io/assets/posts/20180913/1.png) - **동시성(Concurrency) 프로그래밍** : 하나의 코어에서 여러작업을 수행하는 것 - **병렬(Parallelism) 프로그래밍** : 여러개의 코어에서 작업을 수행하는 것! - **예시1)** 단일 Core: 하나의 코어가 여러개의 작업을 수행하고 싶을 때에는 여러개의 스레드 즉, 멀티스레딩을 한다. -> 논리적으로 동시에 수행함(동시성) ![](https://jenkov.com/images/java-concurrency/concurrency-vs-parallelism-1.png) - **예시2)** 다중 Core : 2개의 core가 각각 작업을 수행할 수 있다는 뜻 -> 물리적으로 동시에 수행함(병렬성) ![](https://jenkov.com/images/java-concurrency/concurrency-vs-parallelism-2.png) - **예시3)** 다중 코어 & 다중 스레드 ![](https://jenkov.com/images/java-concurrency/concurrency-vs-parallelism-3.png) - 아이폰14프로 A16 Bionic chip에는 6개의 코어가 있다. 코어가 6개가 있으니까, 당연히 병렬을 고려하는 것이 맞는 건 알겠음. 또한 뷰를 그리는 메인쓰레드에 일을 과중화 시키지 않기 위해 동시성 프로그래밍을 사용하는건 알겠음. 더 자세하게 병렬과 다중 스레드를 이용하는 동시성 프로그래밍을 함께 하는게 iOS 환경과 무슨 연관이 있는 걸까? 스레드는 우리가 만들고 싶은만큼 만들수 있는것인가? - 아이폰 14는 왜 6개인 것일까? 코어가 많으면 무조건 성능이 좋은것일까? - 최적화라는 것을 고려해보아야한다. 6개의 각 코어가 일을 할 때에 모든 코어가 1시간짜리의 일을 10분씩 잘 나누어 일을 했다면 최적화가 잘 되었다고 볼 수 있지만, 한 코어가 일을 잘하고 다른 코어가 일을 못해서 한 코어가 40분 분량의 일을 했다면 최적화가 잘 이루어졌다고 볼 수 없음. - 코어가 여러개일 경우에 각각의 메인 스레드가 있고, 메인스레드의 역할은 뷰를 그린다고 알고 있는데 아이폰14의 경우 누가 뷰를 그리는 것일까?(어느코어의 어느메인스레드가 뷰를 그리는지) - 답변 : 일단 코어마다 메인스레드가 있다는 전제는 틀렸다. 메인스레드는 논리적인 개념이기 때문에 물리적인 코어 1개당 메인스레드 1개를 갖지는 않는다. 마찬가지로 코어가 3개라고 3개의 메인스레드를 갖는건 아니다. 메인스레드를 항상 같은 코어가 처리하지 않을 수도 있다. - iOS에서는 무엇을 더 고려해야 할까? - 일단은, GCD가 알아서 비어있는 코어 또는 다중 쓰레드(main스레드에서 할지/background스레드에서 할지)로 일을 던져주기 때문에 크게 고려할 필요는 없지만, 나중에 우리가 효율적인 최적화를 하기 위해서는 둘 다 고려를 해야 한다. 개발자는 main스레드여부만 결정하면 된다. - 동시성 프로그래밍, 병렬 프로그래밍, 동기(synchronous)와 비동기(asynchronous)의 개념은 어떤 상관관계를 가질까? - 동시성 프로그래밍에서도 동기/비동기 방식으로 작업할 수 있고, - 병렬 프로그래밍에서도 동기/비동기 방식으로 작업할 수 있다. - 애플이 동시성 프로그래밍 또는 병렬 프로그래밍을 지원하기 위해 사용하는 기술엔 무엇무엇이 있을까? - GCD, async, await 또 뭐가 있나? - OperationQueue는 어디에 속하는 개념일까? 별개의 개념인 것일까? - 오퍼레이션 큐와 디스패치 큐의 차이 - **디스패치 큐**: 항상 선입선출 순으로 태스크를 실행, 커뮤니케이션의 양이 적은 간단한 일, 함수를 사용하는 작업 - **오퍼레이션 큐**: `Operation Queue`를 사용하면 작업 실행 방법을 훨씬 더 잘 제어할 수 있다. 예를 들어 일반 GCD 대기열에서는 가능하지 않은 개별 작업 간의 종속성을 정의할 수 있다. 또한 `Operation Queue`에 대기 중인 작업을 취소할 수도 있습니다(작업이 지원하는 한). GCD 디스패치 대기열에서 블록을 대기열에 넣으면 반드시 실행된다. 요약하자면, `Operation Queue`는 취소해야 하거나 복잡한 종속성을 가질 수 있는 장기 실행 작업에 더 적합할 수 있다. GCD 디스패치 대기열은 최소한의 성능 및 메모리 오버헤드를 가져야 하는 짧은 작업에 적합하다. - 프로그래밍에서 Thread는 무엇이고 iOS 환경에서 이를 다루기 위한 방법에는 무엇무엇이 있으며 그 차이는 무엇일까? - GCD, async-await --- #### 🛠 Process, Processor - Windows 운영체제는 32bit 버전, 64bit 버전, ARM 버전 등 다양한 버전이 존재합니다. 이 버전은 어떤 것을 의미하며 왜 이렇게 다양한 버전이 존재해야 할까요? - 아직 해결 못함 - 내 매킨토시의 프로세서는 무엇인가요? ![](https://i.imgur.com/Z1RWJrL.png)![](https://i.imgur.com/pYDFJrD.png) - 코어가 많으면 클럭수가 낮아질 수밖에 없다. 둘다 많으면 너무 뜨거워진다? 클럭은 처리속도! 오버클럭이란말 들어봤나? 클럭을 기존의 수치보다 올려버리는 것! 물리적으로 3GHz 까지 올릴 수 있긴 한데, 올리면 회로가 타버려서 불이 나는 걸 방지하기 위해 쿨러를 엄청 돌려야 하잖아. 오버클럭을 하는 이유는 성능을 끌어올리기 위해서 해야 한다. 예를 들어서, 6개의 코어가 각각 10분 씩의 일을 하기로 했는데, 핫식스 같은거 먹여서 억지로 7분내로 끝내게 하면 애들이 퍼져서 작업을 못하게 된다. 오버클럭하는 사람은 뚜따라고 함. 물리적인 CPU 뚜껑을 열어서 쿨러를 붙임....속도 과시...? - - 애플이 새로 출시한 매킨토시 컴퓨터에서 iOS의 애플리케이션을 실행할 수 있는 이유는 무엇일까요? - 아직 해결 못함 - 이전의 매킨토시 컴퓨터에서는 불가능했던 이유는 무엇일까요? - 아직 해결 못함 - 프로세서를 위한 프로세스 스케쥴링 방식에는 어떤 것이 있는지 간략히 알아봅시다. - 운영체제 입장에서 다양한 프로세스를 스케쥴링하는 규칙을 만들어봅시다. #### 🍄 보너스 - 앞으로 iOS와 macOS는 통합될까요? --- ### 참고자료 - [Concurrency & Parallelism](https://nesoy.github.io/articles/2018-09/OS-Concurrency-Parallelism) - [디스패치큐와 오퍼레이션큐의 차이](https://stackoverflow.com/questions/7078658/operation-queue-vs-dispatch-queue-for-ios-application) - buildNavigationBar() - buildDetailView() - configureAttribute() - configureImageViewConstraints() EntryTableViewCell + buildCell(from: Entry) - configureAttribute() ExpoNavigationController supportedInterfaceOrientations: UIInterfaceOrientationMask

    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