Norman Feske 7d8d4f4532 vfs,libc: deferred wakeup of remote peers
This patch facilitates the batching of I/O operations in the VFS library
by replacing the implicit wakeup of remote peer (via the traditional
packet-stream interface like 'submit_packet') by explicit wakeup
signalling.

The wakeup signalling is triggered not before the VFS user settles down.
E.g., for libc-based applications, this is the case if the libc goes
idle, waiting for external I/O.
In the case of a busy writer to a non-blocking file descriptor or socket
(e.g., lighttpd), the remote peers are woken up once a write operation
yields an out-count of 0.

The deferring of wakeup signals is accommodated by the new 'Remote_io'
mechanism (vfs/remote_io.h) that is designated to be used by all VFS
plugins that interact with asynchronous Genode services for I/O.

Issue #4697
2023-01-24 12:07:27 +01:00

56 lines
1.1 KiB
C++

/*
* \brief Cross-plugin VFS environment
* \author Emery Hemingway
* \author Norman Feske
* \date 2018-04-02
*/
/*
* Copyright (C) 2018-2019 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _INCLUDE__VFS__ENV_H_
#define _INCLUDE__VFS__ENV_H_
#include <vfs/file_system.h>
#include <vfs/remote_io.h>
#include <base/allocator.h>
#include <base/env.h>
namespace Vfs { struct Env; }
struct Vfs::Env : Interface
{
virtual Genode::Env &env() = 0;
/**
* Allocator for creating stuctures shared across open VFS handles
*/
virtual Genode::Allocator &alloc() = 0;
/**
* VFS root file system
*/
virtual File_system &root_dir() = 0;
/**
* Registry of deferred wakeups for plugins interacting with remote peers
*/
virtual Remote_io::Deferred_wakeups &deferred_wakeups() = 0;
/**
* Interface tailored for triggering and waiting for I/O
*/
struct Io : Interface, Genode::Noncopyable
{
virtual void progress() = 0;
};
virtual Io &io() = 0;
};
#endif /* _INCLUDE__VFS__ENV_H_ */