Metadata revisions for unfork-1.0.0.0

Package maintainers and Hackage trustees are allowed to edit certain bits of package metadata after a release, without uploading a new tarball. Note that the tarball itself is never changed, just the metadata that is stored separately. For more information about metadata revisions, please refer to the Hackage Metadata Revisions FAQ.

No. Time User SHA256
-r1 2022-05-31T18:19:54Z chris_martin 7e8c2cd54e89956da09321ea50070c052fc7b75949d8ff1e5275e6cfb2f794ef
  • Changed description from

    “Unfork” is the opposite of “fork”; whereas forking allows things to run concurrently, unforking prevents things from running concurrently. Use one of the functions in the "Unfork" module when you have an action that will be used by concurrent threads but needs to run serially.
    
    A typical use case is a multi-threaded program that writes log messages. If threads use `putStrLn` directly, the strings may be interleaved in the combined output. Instead, create an unforked version of `putStrLn`:
    
    > import Unfork
    >
    > main :: IO ()
    > main =
    >     unforkAsyncIO_ putStrLn \putStrLn' ->
    >         _ -- Within this continuation, use
    >           -- putStrLn' instead of putStrLn
    
    The new `putStrLn'` function writes to a queue. A separate thread reads from the queue and performs the actions, thus ensuring that the actions are all performed in one linear sequence. The main thread returns after the continuation has returned and the queue is empty. If an exception is raised in either thread, both threads halt and the exception is re-raised in the main thread.
    to
    “Unfork” is the opposite of “fork”; whereas forking allows things to run concurrently, unforking prevents things from running concurrently. Use one of the functions in the "Unfork" module when you have an action that will be used by concurrent threads but needs to run serially.
    
    A typical use case is a multi-threaded program that writes log messages. If threads use @putStrLn@ directly, the strings may be interleaved in the combined output. Instead, create an unforked version of @putStrLn@:
    
    > import Unfork
    >
    > main :: IO ()
    > main =
    >     unforkAsyncIO_ putStrLn \putStrLn' ->
    >         _ -- Within this continuation, use
    >           -- putStrLn' instead of putStrLn
    
    The new @putStrLn'@ function writes to a queue. A separate thread reads from the queue and performs the actions, thus ensuring that the actions are all performed in one linear sequence. The main thread returns after the continuation has returned and the queue is empty. If an exception is raised in either thread, both threads halt and the exception is re-raised in the main thread.

-r0 2022-05-31T18:17:57Z chris_martin 317afbb3cb27e1a19b7bd2df831754275a36bc9ff1ff29b97321ec341271ac31