Hi!
What problem are you trying to solve?
Cheers,
V
Hi All,--I would like to execute actors (which have messages in mailboxes and are eligible to execute) in a definite order. I am aware that a particular actor may process its messages in some prioritized manner, but my goal is different. If we have (say) 10 actors ready to execute, can we define the order in which they will be executed? I tried to search through the documentation, but I could not find relevant information. I will appreciate if someone can either comment on this scenario's possibility or at least point me to a relevant document.ThanksSachin
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user?hl=en.
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user?hl=en.
So you don't have any use case?
Cheers,
V
Hi Viktor,
I am still learning akka and after looking at message priority example, I was wondering that whether doing the same with actors is possible or not. By the way, I also do not understand how the actors are picked from the actor pool and run by threads. I mean what part of akka source code does that. Is it done by dispatcher? And do the actors wait in global queue before getting processed by running threads?
Your help is highly appreciated as before.
Thanks
Sachin
Hi,
I am trying to prioritize actors so that all actors are scheduled according to their attached priority. A direct equivalent is a real-time application where threads have priorities and they get scheduled according to them. One drawback of this implementation will be that SystemMessages of a lower priority actor may not get processed till all higher priority actors get executed.
As the first step, I am looking to execute actors with their respective message priority. In this way message priorities become applicable system wide. For example if there are three actors A, B and C with ordered priority mailbox as A={2,4}, B={1,4}, and C={3,5} (Here the mailboxes of A, B and C are ordered due to existing akka message priority support). Then I would like to see execution pattern of
B(1)..A(2)..C(3)..B(4)..A(4)..C(5).....
I looked into the akka code (2.0.4) and figured out that the actors are pushed into a <Runnable> queue using executor interface when a message for the actor is sent. Assuming a thread-pool executor, actor's Runnable will be queued in linkedBlockingQueue and whenever a thread is free it will pick the head element from the queue and execute it.
To implement the target scenario, I believe that I should have a priority queue for Runnables, but there is no priority information (from message) available at that level. Can someone suggest me a possible way out? Should I modify existing queue to a priority queue which contains tuple of <Runnable, priority> and then threads should execute the runnable when they get free? Any help in this is highly appreciated.
Thanks,
Sachin
Hi Viktor,
Thank you for the reply. Can you elaborate what you mean by use case? Do you mean the application which will run or something else? If you mean application, then there are many real-time systems applications which have multiple periodic threads with different priorities (static/dynamic). For example, an industrial control system where threads controlling the valves and assembly line have higher priority as compared to threads displaying the status/information on operator panel.
Please let me know if I have answered your question or not. Otherwise I will try to clarify the scenario further.
Thanks
Sachin