annex.jobs=cpus etc
Added the ability to run one job per CPU (core), by setting annex.jobs=cpus, or using option --jobs=cpus or -Jcpus. Built with future expansion in mind, including not defaulting matching on Concurrency so more constructors can later be added, and using "cpu" instead of "0".
This commit is contained in:
parent
459bbd9005
commit
82186ca58f
20 changed files with 105 additions and 32 deletions
|
@ -262,10 +262,12 @@ implicitMessage = whenM (implicitMessages <$> Annex.getState Annex.output)
|
|||
- the user.
|
||||
-}
|
||||
prompt :: Annex a -> Annex a
|
||||
prompt a = debugLocks $ go =<< Annex.getState Annex.concurrency
|
||||
prompt a = debugLocks $ Annex.getState Annex.concurrency >>= \case
|
||||
NonConcurrent -> a
|
||||
(Concurrent _) -> goconcurrent
|
||||
ConcurrentPerCpu -> goconcurrent
|
||||
where
|
||||
go NonConcurrent = a
|
||||
go (Concurrent {}) = withMessageState $ \s -> do
|
||||
goconcurrent = withMessageState $ \s -> do
|
||||
let l = promptLock s
|
||||
bracketIO
|
||||
(takeMVar l)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue