Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

이 스케줄러를 이용할시, 세밀한 튜닝 전략으로 일부 액터를 분리할수가 있습니다.


Info

지난 몇년간 멀티스레딩 프로그래밍을 통해 개발을 했고 문제를 풀려고 하였습니다.

하지만,5년간 운영하면서 어떠한 한계에 부딪쳤습니다. 스레드문제처리에대해 개발내에 숙련이 유지되지 않는다는점이며

단일기기에서 충분한 사용자처리 성능을 이끌수있으나, 멀티스레드 프로그래밍만으로 스케일아웃을 해결하지못한다는점입니다.

더욱이 현재 느끼는 심각한문제는, 스레드 생성을 지양하는 AKKA를 통해 추상화된 디스페쳐 개념을 익히면서

AKKA가 제공하는 스레드 옵션을 통해 , 멀티스레드를 올바르게 모두사용하지 못했다란 점입니다.

오히려 어떠한 동시성을 위한 추상적 레벨의 라이브러리를통해(AKKA뿐아니라)

멀티스레드를 잘 이해하고, 학습하게 되는 게기가 되었습니다.


말이 길었지만 , AKKA에서는 아래와 같은 스레드 옵션을 지원합니다.

  • thread-count - The number of threads dedicated to this dispatcher.
  • deadlock-timeout - The amount of time to wait before considering the thread as deadlocked. By default no timeout is set, meaning code can run in the threads for as long as they nee. If you set a value, once the timeout is reached the thread will be aborted and a new threads will take it's place. Set this value carefully, as very low values may cause loss of work.
  • threadtype - Must be background or foreground. This setting helps define how .NET handles the thread.



SynchronizedDispatcher

...


No Format
synchronized-dispatcher {
    type = "SynchronizedDispatcher"
    throughput = 10
}


private void Form1_Load(object sender, System.EventArgs e)
{
    system.ActorOf(Props.Create<UIWorker>().WithDispatcher("synchronized-dispatcher"), "ui-worker");
}

...