I currently have an application which uses handcrafted actors. My plan is to to port it to libcaf.
The current state is: I have one big global message queue where my systems (aka actors) subscribe to get their messages. They respond with messages to that global queue.
The whole system is a realtime application which runs on Linux rt-preempt kernel. The GUI thread is a system(actor) itself but it's not on RT priority.
Right now my systems don't need to know the receivers of their messages, because the receivers register for their wanted ones.
My porting idea is as following: I use one global actor as a replacement for my global message queue and it handles the registration for the messages. This way, i can get an easy log of the messages for debugging purpose and i dont need to let all actors know all possible targets.
I have an IO system (canbus) which handles the contact to the real world.
In my current system i spawn the GUI thread + system. It waits for RT to initialize. After the gui thread is spawned, i switch to RT Preempt priority and create the other systems, prefault the stack and so on. When all is setup, i notify the gui that RT is up. Now my system is initilized.
When some fatal things happens or the system Needs to shut down, i send a message and all systems shut down and all threads get joined.
My questions are: How can i seperate the GUI actor/thread from the RT thread in libcaf? Would you recommend to fork the GUI in a seperate process? Can i spawn actors on different RT priority threads?
EDIT: I find the spawn
option detached
. Are the spawned actors (childs of a detached actor) on the same thread?