Remove the "busy" flag and atomic_wait that didn't work out.

This commit is contained in:
Herbert Wolverson 2024-07-09 15:30:39 -05:00
parent 78b5cfeea7
commit 360d82a22d
3 changed files with 2 additions and 34 deletions

26
src/rust/Cargo.lock generated
View File

@ -232,16 +232,6 @@ dependencies = [
"bytemuck",
]
[[package]]
name = "atomic-wait"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a55b94919229f2c42292fd71ffa4b75e83193bffdd77b1e858cd55fd2d0b0ea8"
dependencies = [
"libc",
"windows-sys 0.42.0",
]
[[package]]
name = "atomic-waker"
version = "1.1.2"
@ -1956,7 +1946,6 @@ dependencies = [
name = "lqos_config"
version = "0.1.0"
dependencies = [
"atomic-wait",
"csv",
"dashmap",
"ip_network",
@ -4408,21 +4397,6 @@ dependencies = [
"windows-targets 0.52.5",
]
[[package]]
name = "windows-sys"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
dependencies = [
"windows_aarch64_gnullvm 0.42.2",
"windows_aarch64_msvc 0.42.2",
"windows_i686_gnu 0.42.2",
"windows_i686_msvc 0.42.2",
"windows_x86_64_gnu 0.42.2",
"windows_x86_64_gnullvm 0.42.2",
"windows_x86_64_msvc 0.42.2",
]
[[package]]
name = "windows-sys"
version = "0.45.0"

View File

@ -20,4 +20,3 @@ pyo3 = "0.20"
toml = "0.8.8"
once_cell = "1.19.0"
lqos_utils = { path = "../lqos_utils" }
atomic-wait = "1.1.0"

View File

@ -30,7 +30,6 @@ pub struct NetworkJson {
/// setup makes it hard to performantly lock the whole structure - so we
/// have a messy "busy" compromise.
nodes: Vec<NetworkJsonNode>,
busy: AtomicU32,
}
impl Default for NetworkJson {
@ -42,7 +41,7 @@ impl Default for NetworkJson {
impl NetworkJson {
/// Generates an empty network.json
pub fn new() -> Self {
Self { nodes: Vec::new(), busy: AtomicU32::new(0) }
Self { nodes: Vec::new() }
}
/// The path to the current `network.json` file, determined
@ -97,7 +96,7 @@ impl NetworkJson {
}
}
Ok(Self { nodes, busy: AtomicU32::new(0) })
Ok(Self { nodes })
}
/// Find the index of a circuit_id
@ -157,7 +156,6 @@ impl NetworkJson {
/// access.
pub fn zero_throughput_and_rtt(&self) {
//log::warn!("Locking network tree for throughput cycle");
self.busy.store(1, SeqCst);
self.nodes.iter().for_each(|n| {
n.current_throughput.set_to_zero();
n.current_tcp_retransmits.set_to_zero();
@ -168,9 +166,6 @@ impl NetworkJson {
}
pub fn cycle_complete(&self) {
//log::warn!("Unlocking network tree");
self.busy.store(0, SeqCst);
atomic_wait::wake_all(&self.busy);
}
/// Add throughput numbers to node entries. Note that this does *not* require