Browse Source

Rename affinity to "ideal processor"

pull/46/head
AzureMarker 3 years ago
parent
commit
debf941bc3
No known key found for this signature in database
GPG Key ID: 47A133F3BF9D03D3
  1. 2
      ctru-rs/examples/futures-basic.rs
  2. 2
      ctru-rs/examples/futures-tokio.rs
  3. 2
      ctru-rs/examples/thread-locals.rs

2
ctru-rs/examples/futures-basic.rs

@ -30,7 +30,7 @@ fn main() {
let (exit_sender, mut exit_receiver) = futures::channel::oneshot::channel(); let (exit_sender, mut exit_receiver) = futures::channel::oneshot::channel();
let (mut timer_sender, mut timer_receiver) = futures::channel::mpsc::channel(0); let (mut timer_sender, mut timer_receiver) = futures::channel::mpsc::channel(0);
let executor_thread = std::thread::Builder::new() let executor_thread = std::thread::Builder::new()
.affinity(1) .ideal_processor(1)
.spawn(move || { .spawn(move || {
let mut executor = futures::executor::LocalPool::new(); let mut executor = futures::executor::LocalPool::new();

2
ctru-rs/examples/futures-tokio.rs

@ -30,7 +30,7 @@ fn main() {
let runtime_thread = std::thread::Builder::new() let runtime_thread = std::thread::Builder::new()
// Run on the system core // Run on the system core
.affinity(1) .ideal_processor(1)
.spawn(move || { .spawn(move || {
runtime.block_on(async move { runtime.block_on(async move {
let mut wake_time = tokio::time::Instant::now() + Duration::from_secs(1); let mut wake_time = tokio::time::Instant::now() + Duration::from_secs(1);

2
ctru-rs/examples/thread-locals.rs

@ -32,7 +32,7 @@ fn main() {
}); });
std::thread::Builder::new() std::thread::Builder::new()
.affinity(1) .ideal_processor(1)
.spawn(move || { .spawn(move || {
MY_LOCAL.with(|local| { MY_LOCAL.with(|local| {
println!("Initial value on second thread: {}", local.borrow()); println!("Initial value on second thread: {}", local.borrow());

Loading…
Cancel
Save