Concurrency is not parallelism
on the Go (!) blog, uses a very similar one
a < b
or b < a
(where <
in this case is happened before), and therefore a
and b
are concurrent
happens before
is more general (Lamport really is a genius), but doesn't help with the aspect that matters of the talk, i.e. the logical thread as a structuring abstraction
java.lang.Thread
and Fiber
are not any different
r is it a general term
also to clarify, it depends on who's using that term, it's overloaded and often it means something even weaker than fiber. But in my talk, I meant the general idea as it applies to OS processes, Thread
, fibers, and even manually stepped coroutines (like the one in PureConc in ce3)
Why do i get stack overflow here, isnt flatmap suppose to be stack safe?
def loop: F[Unit] = {
x.state.read.flatMap {
case CommChannel.Ready =>
log("ready")
case CommChannel.Disconnected =>
log("disconnect")
case CommChannel.Other(content) =>
log(s"other $content")
case a: CommChannel.ActionRequired[F] =>
log(s"action required: ${a.content}") *>
read.flatMap(x => a.response.complete(x))
} *> loop
}
loop.start *> Sync[F].unit
(state is MVar)
Temporal <: Concurrent
, does that mean any code wanting to read the current time also gains the ability to do concurrency? That would be a big drawback for parametric reasoning IMO