scheduler-2.0.0.1: Work stealing scheduler.
Copyright(c) Alexey Kuleshevich 2020
LicenseBSD3
MaintainerAlexey Kuleshevich <lehins@yandex.ru>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Control.Scheduler.Global

Description

 
Synopsis

Documentation

data GlobalScheduler Source #

A thread safe wrapper around Scheduler, which allows it to be reused indefinitely and globally if need be. There is one already created in this library: globalScheduler

Since: 1.5.0

globalScheduler :: GlobalScheduler Source #

Global scheduler with Par computation strategy that can be used anytime using withGlobalScheduler_

newGlobalScheduler :: MonadIO m => Comp -> m GlobalScheduler Source #

Create a new global scheduler, in case a single one globalScheduler is not sufficient. It is important to note that too much parallelization can significantly degrate performance, therefore it is best not to use more than one scheduler at a time.

Since: 1.5.0

withGlobalScheduler_ :: MonadUnliftIO m => GlobalScheduler -> (Scheduler RealWorld () -> m a) -> m () Source #

Use the global scheduler if it is not busy, otherwise initialize a temporary one. It means that this function by itself will not block, but if the same global scheduler used concurrently other schedulers might get created.

Since: 1.5.0