RustAudio / cpal

Cross-platform audio I/O library in pure Rust
Apache License 2.0
2.64k stars 350 forks source link

multithreading in OSX #505

Open kopotp opened 3 years ago

kopotp commented 3 years ago

when CPAL stream is created on Mac OS - number of threads is increasing from 1 to 9-10. Doesn't it suppose to start only 1 new high-priority audio thread provided by CoreAudio ?

mitchmindtree commented 3 years ago

Neither cpal or coreaudio-rs are explicitly spawning these threads, if any. From memory, we don't spawn any as CoreAudio has a non-blocking API anyway. Perhaps the CoreAudio API implicitly initialises a thread pool or something along these lines when the first stream is spawned? This is just a guess though.