slouc / concurrency-in-scala-with-ce Goto Github PK
View Code? Open in Web Editor NEWIntroduction to concepts of asynchronous and concurrent programming in Scala, based on the Cats Effect library.
Introduction to concepts of asynchronous and concurrent programming in Scala, based on the Cats Effect library.
The section in which is given the definition of a Fiber says that
Also, blocking a fiber doesn't block the underlying thread.
Since in text there isn't an explanation for this behaviour I think that would be great to add it. I'd submit a PR but unfortunately I haven't yet understood how it's possible to implement such a behaviour π .
Hi, how are you, I was reading this part, and I think it might be missing some information about the thread pool queue
"Blocking asynchronous operations:
Unbounded cached pool. Unbounded because blocking operation can (and will) block a thread for some time, and we want to be able to serve other I/O requests in the meantime. Cached because we could run out of memory by creating too many threads, so itβs important to reuse existing threads."
You can also get out of memory if you use an unbounded tasks queue in the threadpool. If all the cached threads are in use, your queue might go up and your app go down. my 2 cents
Hi, I really really love your write-up. I just have a small question.
Since a for-comprehension is a series of nested flatMap
s where the computation is sequenced, and the result of a previous computation is used to get the next computation. Shouldn't the Run loop here be:
FlatMap(
Delay(() => println("What's up?")),
(_: Unit) => FlatMap(
Delay(() => readLine),
(input: String) => Delay(() => println(s"Ah, $input is up!"))
)
)
where the function k
is what leads to the next FlatMap
?
Using a toy interpreter, funny enough, I can't seem to see any difference between the two.
In the shift example you wrote
Code is pretty straightforward - we have a recursive loop that goes on forever, and all it does is print out some ID ("A" or "B").
On my reading and executing this, the first example with def loop
prints "A" continually. (I commented out the 'shift' to match your example).
Hey π€,
I am a bit newer about concurrency and parallelism and I would like to make an open question. Which is the different between parallel execution and parallelism in the docs? Reading the repository I don't really know if we are threatening the concept like one. There is any specific example I can check to visualise how a task is subdivided in subtask and paralleled?
Thank you! π
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.