Community

개발자 99% 커뮤니티에서 수다 떨어요!

← Go back
#Assignment 9 - 6.동시성
#pragmatic
2년 전
529
2

오늘 TIL 3줄 요약

  • Concurrency is a requirement in our system

  • Try to use transaction, semaphores for concurrency issues

  • Consider using Actor for concurrency without a shared state

TIL (Today I Learned) 날짜

2022.03.30

오늘 읽은 범위

Chapter 6 - Concurrency

책에서 기억하고 싶은 내용을 써보세요.

Topic 33. Breaking Temporal Coupling
  • Activity diagrams show the potential areas of concurrency but have nothing to say about whether these areas are worth exploiting.

  • Remember the distinction: concurrency is a software mechanism, and parallelism is a hardware concern.

Topic 34. Shared State Is Incorrect State
  • A semaphore is simply a thing that only one person can own at a time. You can create a semaphore and then use it to control access to some other resource.

  • The current design is poor because it delegates responsibility for protecting access to the pie case to the people who use it. Let’s change it to centralize that control.

  • This caused the build to fail but in bizarre ways and random places.

  • Most languages have library support for some kind of exclusive access to shared resources. They may call it mutexes (for mutual exclusion), monitors, or semaphores.

Topic 35. Actors and Processes
  • An actor is an independent virtual processor with its own local (and private) state.

  • A process is typically a more general-purpose virtual processor, often implemented by the operating system to facilitate concurrency.

  • In the actor model, there’s no need to write any code to handle concurrency, as there is no shared state.

Topic 36. Blackboards
  • This is a form of laissez faire concurrency.

  • Order of data arrival is irrelevant: when a fact is posted it can trigger the appropriate rules.

  • The actor and/or blackboard and/or microservice approach to architecture removes a whole class of potential concurrency problems from your applications. But that benefit comes at a cost. These approaches are harder to reason about because a lot of the action is indirect.

오늘 읽은 소감은? 떠오르는 생각을 가볍게 적어보세요

  • In this chapter, it was easy to understand by examples.

  • I learned about concurrency when learning about DB or threads, but I didn't care about it when writing code. Next time, I should try to consider concurrency.

  • I learned about the actor for the first time. I should check more examples of use.

2 comments