Launch every 100ms (#364)

This commit is contained in:
s1341 2021-11-07 18:56:16 +02:00 committed by GitHub
parent 3ffcfde9a3
commit bd7ce8d0ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,8 +112,10 @@ where
println!("spawning on cores: {:?}", self.cores); println!("spawning on cores: {:?}", self.cores);
// Spawn clients // Spawn clients
for (index, (id, bind_to)) in core_ids.iter().enumerate().take(num_cores).enumerate() { let mut index = 0_u64;
for (id, bind_to) in core_ids.iter().enumerate().take(num_cores) {
if self.cores.iter().any(|&x| x == id) { if self.cores.iter().any(|&x| x == id) {
index += 1;
self.shmem_provider.pre_fork()?; self.shmem_provider.pre_fork()?;
match unsafe { fork() }? { match unsafe { fork() }? {
ForkResult::Parent(child) => { ForkResult::Parent(child) => {
@ -127,7 +129,7 @@ where
self.shmem_provider.post_fork(true)?; self.shmem_provider.post_fork(true)?;
#[cfg(feature = "std")] #[cfg(feature = "std")]
std::thread::sleep(std::time::Duration::from_secs((index + 1) as u64)); std::thread::sleep(std::time::Duration::from_millis(index * 100));
#[cfg(feature = "std")] #[cfg(feature = "std")]
if let Some(filename) = self.stdout_file { if let Some(filename) = self.stdout_file {