mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-22 06:48:43 -06:00
drop kubi-pool
This commit is contained in:
parent
f157e2dab3
commit
7620717368
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -1190,10 +1190,6 @@ dependencies = [
|
|||
"log",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kubi-pool"
|
||||
version = "0.0.0"
|
||||
|
||||
[[package]]
|
||||
name = "kubi-server"
|
||||
version = "0.0.0"
|
||||
|
|
|
@ -4,7 +4,6 @@ members = [
|
|||
"kubi-server",
|
||||
"kubi-shared",
|
||||
"kubi-logging",
|
||||
"kubi-pool"
|
||||
]
|
||||
default-members = ["kubi"]
|
||||
resolver = "2"
|
||||
|
|
|
@ -118,15 +118,12 @@ name = "Kubi Server" # server name
|
|||
|
||||
<h2>"In-house" libraries</h2>
|
||||
|
||||
- [`hui`](https://github.com/griffi-gh/hui): semi-imm.mode backend-agnostic ui system\
|
||||
mostly ready to use, it has already replaced the Kubi legacy ui
|
||||
- [`kubi-ui-glium`](kubi-ui-glium) Glium-based backend for `kubi-ui`
|
||||
- [`kubi-pool`](kubi-pool): very early work-in-progress work-stealing threadpool system\
|
||||
aiming to replace `rayon` threadpool that's currently used inside the kubi client (for more control over task priority)
|
||||
- [`hui`, `hui-glium`, `hui-winit`](https://github.com/griffi-gh/hui): semi-imm.mode backend-agnostic ui system\
|
||||
- [`kubi-logging`](kubi-logging) fancy-ass custom formatter for `env-logger`
|
||||
|
||||
deprecated:
|
||||
|
||||
~~`kubi-udp`~~ was a huge pita to work with and eventually got replaced by `uflow` (https://github.com/lowquark/uflow) in #5
|
||||
- ~~`kubi-udp`~~ eventually got replaced by `uflow` (https://github.com/lowquark/uflow) in #5
|
||||
- ~~`kubi-pool`~~ decided there's no need to replace rayon for now
|
||||
|
||||
<h6 align="right"><i>~ uwu</i></h6>
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
[package]
|
||||
name = "kubi-pool"
|
||||
version = "0.0.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
|
@ -1,33 +0,0 @@
|
|||
use std::{thread::JoinHandle, collections::VecDeque};
|
||||
|
||||
pub struct KubiPool<T, R> {
|
||||
callback: fn(T) -> R,
|
||||
threads: Vec<JoinHandle<()>>,
|
||||
}
|
||||
|
||||
struct Task<T> {
|
||||
priority: u8,
|
||||
data: T,
|
||||
}
|
||||
|
||||
fn task_loop<T, R>() {
|
||||
let tasks = VecDeque::<Task<T>>::new();
|
||||
loop {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
impl<T: 'static, R: 'static> KubiPool<T, R> {
|
||||
pub fn new(threads: usize, callback: fn(T) -> R) -> Self {
|
||||
Self {
|
||||
callback,
|
||||
threads: (0..threads).map(|_| {
|
||||
std::thread::spawn(move || task_loop::<T, R>())
|
||||
}).collect(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn resize(&mut self, threads: usize) {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue