Skip to content
Snippets Groups Projects
Commit 54946e4f authored by Duncan Coutts's avatar Duncan Coutts Committed by Marge Bot
Browse files

Start to centralise the I/O manager hooks from other bits of the RTS

It is currently rather difficult to understand or work with the various
I/O manager implementations. This is for a few reasons:

1. They do not have a clear or common API. There are some common
   function names, but a lot of things just get called directly.
2. They have hooks into many other parts of the RTS where they get
   called from.
3. There is a _lot_ of CPP involved, both THREADED_RTS vs !THREADED_RTS
   and also mingw32_HOST_OS vs !mingw32_HOST_OS. This doesn't really
   identify the I/O manager implementation.
4. They have data structures with unclear ownership, or that are
   co-owned with other components like the scheduler. Some data
   structures are used by multiple I/O managers.

One thing that would help is if the interface between the I/O managers
and the rest of the RTS was clearer, even if it was not completely
uniform. Centralising it would make it easier to see how to reduce any
unnecessary diversity in the interfaces.

This patch makes a start by creating a new IOManager.{h,c} module. It is
initially empty, but we will move things into it in subsequent patches.
parent 8bdbfdd8
No related branches found
No related tags found
No related merge requests found
/* -----------------------------------------------------------------------------
*
* (c) The GHC Team 1998-2020
*
* Hooks for the I/O subsystem(s) that are called from other parts of the RTS.
*
* There are several different I/O subsystem implementations (aka I/O managers),
* for different platforms (notably Windows vs others), and for the threaded vs
* non-threaded RTS. These implementations all need hooks into other parts of
* the RTS, such as startup/shutdown, the scheduler and other special features.
*
* To keep things comprehensible, all the hooks used by all the different I/O
* subsystem implementations are centralised here. Not all implementations use
* all hooks.
*
* -------------------------------------------------------------------------*/
#include "Rts.h"
#include "rts/IOInterface.h" // exported
#include "IOManager.h" // RTS internal
/* -----------------------------------------------------------------------------
*
* (c) The GHC Team 1998-2020
*
* Prototypes for functions in IOManager.c and elsewhere
*
* Hooks for the I/O subsystem(s) that are called from other parts of the RTS.
*
* There are several different I/O subsystem implementations (aka I/O managers),
* for different platforms (notably Windows vs others), and for the threaded vs
* non-threaded RTS. These implementations all need hooks into other parts of
* the RTS, such as startup/shutdown, the scheduler and other special features.
*
* To keep things comprehensible, all the hooks used by all the different I/O
* subsystem implementations are centralised here. Not all implementations use
* all hooks.
*
* -------------------------------------------------------------------------*/
#pragma once
#include "BeginPrivate.h"
#include "EndPrivate.h"
......@@ -433,6 +433,7 @@ library
HsFFI.c
Inlines.c
Interpreter.c
IOManager.c
LdvProfile.c
Libdw.c
LibdwPool.c
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment