Question - if you have a single system but have multiple arbiters in it running, is it STILL a single threaded event loop?
Reading through the Actix book - https://actix.rs/book/actix/sec-6-sync-arbiter.html
When you normally run Actors, there are multiple Actors running on the System's Arbiter thread, using its event loop
And also from https://actix.rs/book/actix/sec-5-arbiter.html
While it only uses one thread, it uses the very efficient event loop pattern which works well for asynchronous events. To handle synchronous, CPU-bound tasks, it's better to avoid blocking the event loop and instead offload the computation to other threads. For this usecase, read the next section and consider using SyncArbiter.
Question Repeated - if you have a single system but have multiple arbiters in it running, is it STILL a single threaded event loop?
Example
let sys = System::new();
sys.block_on( async move {
let arbiter1 = Arbiter::new(); // one arbiter here
arbiter1.spawn( SOME ACTOR);
let arbiter2 = Arbiter::new(); // another arbiter here
arbiter2.spanw( SOME OTHER ACTOR);
});
sys.run().unwrap();
Does this run in a single thread?
When I log it using log4rs I see the following
[actix-rt|system:0|arbiter:0]
[actix-rt|system:0|arbiter:1]
Given that it is system:0 - does this mean it is the same thread just using different arbiters?
Do I need to run multiple System::new
in order to achieve proper multi threading in actix?