Skip to content

Commit

Permalink
Mention interrupts and green threads
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhoo committed Apr 7, 2017
1 parent 8fc3ab2 commit e6597e1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/doc/unstable-book/src/compiler-barriers.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ racing *with itself*. That is, if a given thread is executing one piece
of code, and is then interrupted, and starts executing code elsewhere
(while still in the same thread, and conceptually still on the same
core). In traditional programs, this can only occur when a signal
handler is registered. Consider the following code:
handler is registered. In more low-level code, such situations can also
arise when handling interrupts, when implementing green threads with
pre-emption, etc.

To give a straightforward example of when a `compiler_barrier` is
necessary, consider the following example:

```rust
# use std::sync::atomic::{AtomicBool, AtomicUsize};
Expand Down

0 comments on commit e6597e1

Please sign in to comment.