Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module provides a container-/cgroup-aware substitute for GHC's RTS
-N
flag. See initRTSThreads
.
Synopsis
- initRTSThreads :: IO ()
- initRTSThreadsWith :: RoundQuota -> IO ()
- data RoundQuota
Documentation
initRTSThreads :: IO () Source #
A container-/cgroup-aware substitute for GHC's RTS -N
flag.
On most platforms, this sets the number of runtime threads to match the
number of physical processors (see getNumProcessors
), which is the
default behavior of the GHC -N
flag.
When running within a cgroup on linux (most often within a container), this observes the current process' cgroup cpu quota to constrain the number of runtime threads.
By default, the number of capabilities is determined by rounding the CPU quota down.
See CPUQuota
initRTSThreadsWith :: RoundQuota -> IO () Source #
Same as initRTSThreads
but lets you specify the quota round mode.
data RoundQuota Source #
CPU quotas can be fractions, but the number of RTS capabilities is an integer. This type determines how to round the CPU quota to get to the number of capabilities.
The names correspond to the similarly named methods of RealFrac
.
Instances
Read RoundQuota Source # | |
Defined in Control.Concurrent.CGroup readsPrec :: Int -> ReadS RoundQuota # readList :: ReadS [RoundQuota] # readPrec :: ReadPrec RoundQuota # readListPrec :: ReadPrec [RoundQuota] # | |
Show RoundQuota Source # | |
Defined in Control.Concurrent.CGroup showsPrec :: Int -> RoundQuota -> ShowS # show :: RoundQuota -> String # showList :: [RoundQuota] -> ShowS # | |
Eq RoundQuota Source # | |
Defined in Control.Concurrent.CGroup (==) :: RoundQuota -> RoundQuota -> Bool # (/=) :: RoundQuota -> RoundQuota -> Bool # | |
Ord RoundQuota Source # | |
Defined in Control.Concurrent.CGroup compare :: RoundQuota -> RoundQuota -> Ordering # (<) :: RoundQuota -> RoundQuota -> Bool # (<=) :: RoundQuota -> RoundQuota -> Bool # (>) :: RoundQuota -> RoundQuota -> Bool # (>=) :: RoundQuota -> RoundQuota -> Bool # max :: RoundQuota -> RoundQuota -> RoundQuota # min :: RoundQuota -> RoundQuota -> RoundQuota # |