4

I'm looking for a solution, where several actors should sit on single thread. In this thread I have OpenGL context and I want to separate resource creation code (e.g. shader compilation) from resource using code (e.g. rendering loop).

Is this possible? Same issue will exists for GUI-based applications, I suppose. Like Swing, which is single-threaded. So, I believe there should be a solution.

Currently I have following configuration for rendering thread:

renderer-dispatcher {
  executor = "thread-pool-executor"
  type = PinnedDispatcher
  thread-pool-executor.allow-core-timeout=off
}

akka.actor.deployment {
  /renderer {
    dispatcher = renderer-dispatcher
  }
}
Seagull
  • 13,484
  • 2
  • 33
  • 45
  • 3
    If you use a pinned dispatcher, each instance of an actor that uses that dispatcher will have it's own thread, so a 1-1 relationship between actor instances and threads. If you want a single thread to be shared across many actors (which I have my doubts about doing) then you could create a thread pool based dispatcher with a single thread I suppose. – cmbaxter May 12 '15 at 19:30
  • @cmbaxter Magnificent! Thank you. I do not know, why this bright idea doesn't come into my mind. If you answer, about using thread-pool with single thread in it, I'll be able to accept answer. – Seagull May 12 '15 at 19:36

0 Answers0