Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[runtime] Enhancement: Move background coroutines to own group #1296

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/rust/catmem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,16 @@ impl SharedCatmemLibOS {
pub fn wait_next_n<Acceptor: FnMut(demi_qresult_t) -> bool>(
&mut self,
mut acceptor: Acceptor,
timeout: Duration
) -> Result<(), Fail>
{
self.runtime.clone().wait_next_n(
|qt, qd, result| acceptor(self.create_result(result, qd, qt)), timeout)
timeout: Duration,
) -> Result<(), Fail> {
self.runtime
.clone()
.wait_next_n(|qt, qd, result| acceptor(self.create_result(result, qd, qt)), timeout)
}

/// Waits for any operation in an I/O queue.
pub fn poll(&mut self) {
self.runtime.poll()
pub fn poll_task(&mut self, qt: QToken) {
self.runtime.poll_task(qt)
}

pub fn create_result(&self, result: OperationResult, qd: QDesc, qt: QToken) -> demi_qresult_t {
Expand Down
2 changes: 1 addition & 1 deletion src/rust/catnap/win/overlapped.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ mod tests {

let result: OperationResult = loop {
iocp.get_mut().process_events()?;
runtime.poll();
runtime.poll_task(server_task);
if let Some((_, result)) = runtime.get_completed_task(&server_task) {
break result;
}
Expand Down
10 changes: 4 additions & 6 deletions src/rust/demikernel/libos/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,8 @@ impl MemoryLibOS {
pub fn wait_next_n<Acceptor: FnMut(demi_qresult_t) -> bool>(
&mut self,
acceptor: Acceptor,
timeout: Duration
) -> Result<(), Fail>
{
timeout: Duration,
) -> Result<(), Fail> {
trace!("wait_next_n(): acceptor, timeout={:?}", timeout);
match self {
#[cfg(feature = "catmem-libos")]
Expand All @@ -130,7 +129,6 @@ impl MemoryLibOS {
}
}


/// Allocates a scatter-gather array.
#[allow(unreachable_patterns, unused_variables)]
pub fn sgaalloc(&self, size: usize) -> Result<demi_sgarray_t, Fail> {
Expand All @@ -153,10 +151,10 @@ impl MemoryLibOS {

/// Waits for any operation in an I/O queue.
#[allow(unreachable_patterns, unused_variables)]
pub fn poll(&mut self) {
pub fn poll_task(&mut self, qt: QToken) {
match self {
#[cfg(feature = "catmem-libos")]
MemoryLibOS::Catmem(libos) => libos.poll(),
MemoryLibOS::Catmem(libos) => libos.poll_task(qt),
_ => unreachable!("unknown memory libos"),
}
}
Expand Down
Loading
Loading