Hi,
trying to understand deeply the control module and so the control component, I would to know how many task are created when the control component is created and how they are managed. A task is created when the component start and the others when the component initializes the readers? And these task how are scheduled? They are in a thread pool or for this component not?
Thanks
The cyber Component is divided to two types. one is event-base and another is timer-base. The control component is timer-base. The underlying implementation is still through a coroutine to perform tasks. You can adjust the priority in "cyber/conf/control_sched_classic.conf"
The reader in control module have no callback func, and do read in proc.
chassis_reader_ =
node_->CreateReader<Chassis>(chassis_reader_config, nullptr); // callback is null
ACHECK(chassis_reader_ != nullptr);
Therefore, these readers do not have any coroutine to execute it. If there is a callback func, then the callback func will called when the message is received, the function will be executed in an new coroutine.
There is a thread pool in Apollo to execute all the task? And what task does the scheduler class perform? what change between classic scheduler and choreography scheduler?
Simply say.
choreography have a pool but classic not. Can both schedulers coexist or is only one created based on the configuration file?
You can choice only one of them.
By the way, classic is a subset of the choreography, because choreography have extra thread pool.
What is the difference between InnerThread and Task?
There are also thread used by apollo, and SetInnerThreadAttr will set cup set and cup affinity
I understood that each class Processor instance is a thread, it is right? And these threads how start and run? Who schedule them?
What is the difference between an InnerThread and a 'processor thread'?
Logical Processor, you can read more about go's GMP model,they are almost the same.CreateProcessor create thread and bind to Processor, multi coroutine will run on Processor, and thread schedule by linux, coroutine schedule by cyber.So, to sum it up. In apollo there are various threads, InnerThread and 'processor thread'. For example, an InnerThread is the TimingWheel that schedules all the timer components and sends to the 'processor threads' the task of the component, for example the Proc function of the control module. At the end the 'processor thread' schedules the tasks and run them. It is right?
Yes, you are right