spawn is:exact
Create a new end point, fork a new thread, and run the specified IO
operation on that thread.
Returns the address of the new end point.
Spawn a mailbox using the specified
Buffer to store messages
Using
send on the
Output
- fails and returns False if the mailbox is sealed, otherwise
it:
- retries if the mailbox is full, or:
- adds a message to the mailbox and returns True.
Using
recv on the
Input:
- retrieves a message from the mailbox wrapped in Just if the
mailbox is not empty, otherwise it:
- retries if the mailbox is not sealed, or:
- fails and returns Nothing.
If either the
Input or
Output is garbage collected the
mailbox will become sealed.
spawn. Launch an external application. Specifically, it double-forks
and runs the
String you pass as a command to /bin/sh.
Note this function assumes your locale uses utf8.
Create a concurrent computation for the provided action, and return a
MVar which can be used to query the result.
Increase the sample size by a given factor. The weights are adjusted
such that their sum is preserved. It is therefore safe to use
spawn in arbitrary places in the program without introducing
bias.
Not on Stackage, so not searched.
Tiny library for concurrent computations
A morphism from the initial object i in cat to
a.
Examples
Start up a concurrent process and get a reference to it