Skip to content

Commit

Permalink
Merge pull request #2154 from djspiewak/topic/concepts-cleanup
Browse files Browse the repository at this point in the history
Some light cleanup on the concepts page
  • Loading branch information
djspiewak authored Jul 25, 2021
2 parents 373d03c + 3cdfb2b commit 8e514f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ Secondarily, cancelation can be suppressed within scoped regions. If a fiber is

Finally, due to the fact that the fiber model offers much more control and tighter guarantees around cancelation, it is possible and safe to dramatically increase the granularity of cancelation within the target fiber. In particular, every *step* of a fiber contains a cancelation check. This is similar to what `interrupt` would do if the JVM checked the interruption flag on every `;`. This is exactly how the `loop` fiber in the example above is canceled despite the fact that the thread never blocks. Anyone who has ever attempted to use `Thread#interrupt` on a `while`-loop understands how important this distinction is: in Cats Effect, canceling this kind of fiber is possible and indeed quite common.

## "Asynchronous" vs "Concurrent" vs "Parallel"
## Terminology

It is quite common in most imperative language contexts (including Scala) to conflate these three terms. "Asynchronous" in particular is often taken to be synonymous with "parallel", when in fact all three have a very distinct definition which becomes significant in frameworks like Cats Effect.
It is quite common in most imperative language contexts (including Scala) to conflate the terms "asynchronous", "concurrent", and "parallel". "Asynchronous" in particular is often taken to be synonymous with "parallel", when in fact all three have a very distinct definition which becomes significant in frameworks like Cats Effect.

### Asynchronous

Expand Down Expand Up @@ -184,7 +184,7 @@ As another implementation detail, it is worth noting that fibers are prevented f

An effect is a description of an action (or actions) that will be taken when evaluation happens. One very common sort of effect is `IO`:

```scala mdoc
```scala mdoc:silent
val printer: IO[Unit] = IO.println("Hello, World")
val printAndRead: IO[String] = IO.print("Enter your name: ") >> IO.readLine

Expand Down Expand Up @@ -258,7 +258,7 @@ When side-effecting code is wrapped in one of these constructors, the code itsel

For example, we can wrap the `System.out.println` side-effecting code from earlier to convert it into an effect value:

```scala mdoc
```scala mdoc:silent
val wrapped: IO[Unit] = IO(System.out.println("Hello, World"))
```

Expand Down

0 comments on commit 8e514f4

Please sign in to comment.