Hoogle Search

Within LTS Haskell 24.52 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. rtsSupportsBoundThreads :: Bool

    concurrency Control.Monad.Conc.Class

    Deprecated: Use supportsBoundThreads instead

  2. runInBoundThread :: MonadConc m => m a -> m a

    concurrency Control.Monad.Conc.Class

    Run the computation passed as the first argument. If the calling thread is not bound, a bound thread is created temporarily. runInBoundThread doesn't finish until the inner computation finishes. You can wrap a series of foreign function calls that rely on thread-local state with runInBoundThread so that you can use them without knowing whether the current thread is bound.

  3. runInUnboundThread :: MonadConc m => m a -> m a

    concurrency Control.Monad.Conc.Class

    Run the computation passed as the first argument. If the calling thread is bound, an unbound thread is created temporarily using fork. runInBoundThread doesn't finish until the inner computation finishes. Use this function only in the rare case that you have actually observed a performance loss due to the use of bound threads. A program that doesn't need its main thread to be bound and makes heavy use of concurrency (e.g. a web server), might want to wrap its main action in runInUnboundThread. Note that exceptions which are thrown to the current thread are thrown in turn to the thread that is executing the given computation. This ensures there's always a way of killing the forked thread.

  4. supportsBoundThreads :: MonadConc m => m Bool

    concurrency Control.Monad.Conc.Class

    Returns True if bound threads can be forked. If False, isCurrentThreadBound will always return False and both forkOS and runInBoundThread will fail.

  5. threadDelay :: MonadConc m => Int -> m ()

    concurrency Control.Monad.Conc.Class

    Yields the current thread, and optionally suspends the current thread for a given number of microseconds. If suspended, there is no guarantee that the thread will be rescheduled promptly when the delay has expired, but the thread will never continue to run earlier than specified.

    threadDelay _ = yield
    

  6. tryReadMVar :: MonadConc m => MVar m a -> m (Maybe a)

    concurrency Control.Monad.Conc.Class

    Attempt to read a value from a MVar non-blockingly, returning a Just if there is something there, otherwise returning Nothing. As with readMVar, this does not "remove" the value.

  7. acquireRead :: RWLock -> IO ()

    concurrent-extra Control.Concurrent.ReadWriteLock

    Acquire the read lock. Blocks if another thread has acquired write access. If acquireRead terminates without throwing an exception the state of the RWLock will be "read". Implementation note: Throws an exception when more than (maxBound :: Int) simultaneous threads acquire the read lock. But that is unlikely.

  8. newAcquiredRead :: IO RWLock

    concurrent-extra Control.Concurrent.ReadWriteLock

    Create a new RWLock in the "read" state; only read can be acquired without blocking.

  9. releaseRead :: RWLock -> IO ()

    concurrent-extra Control.Concurrent.ReadWriteLock

    Release the read lock. If the calling thread was the last one to relinquish read access the state will revert to "free". It is an error to release read access to an RWLock which is not in the "read" state.

  10. tryAcquireRead :: RWLock -> IO Bool

    concurrent-extra Control.Concurrent.ReadWriteLock

    Try to acquire the read lock; non blocking. Like acquireRead, but doesn't block. Returns True if the resulting state is "read", False otherwise.

Page 689 of many | Previous | Next