Copyright | (c) Dong Han 2020 |
---|---|
License | BSD |
Maintainer | [email protected] |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Z.IO
Description
This re-exports several common modules to be used together with file, network, and other specific modules, such as resource management, buffered IO and std streams.
Synopsis
- module Z.IO.Buffered
- module Z.IO.Environment
- module Z.IO.Exception
- module Z.IO.Logger
- module Z.IO.Resource
- module Z.IO.StdStream
- forkBa :: IO () -> IO ThreadId
Documentation
module Z.IO.Buffered
module Z.IO.Environment
module Z.IO.Exception
module Z.IO.Logger
module Z.IO.Resource
module Z.IO.StdStream
forkBa :: IO () -> IO ThreadId Source #
Fork a new GHC thread with active load-balancing.
Using libuv based IO solution has a disadvantage that file handlers are bound to certain uv_loop, thus certain uv mananger/capability. Worker threads that migrate to other capability will lead contention since various APIs here is protected by manager's lock, this makes GHC's work-stealing strategy unsuitable for certain workload, such as a webserver. we solve this problem with simple round-robin load-balancing: forkBa will automatically distribute new threads to all capabilities in round-robin manner. Thus its name forkBa(lance).