3 ms·
No, each request is handled concurrently in the same thread using evented IO. You spawn fibers, which are the analogue to go's goroutines, and many of those run
by RX14 8y ago
No, each request is handled concurrently in the same thread using evented IO. You spawn fibers, which are the analogue to go's goroutines, and many of those run in one thread. Just like nodejs (without callbacks/promises/async/await) and similar to go with GOMAXPROCS=1.
Unfortunately, I don't have a timeframe for parallelism, it's not my area of crystal and it's a fairly tricky issue.
My (biased, i'm a core developer) view on Crystal's maturity, after using it in a few of my own side-projects, is that once crystal code compiles, it runs pretty much rock solid in production. Compiler bugs are fairly rare too, although the compiler clearly isn't as mature as gcc. The main issue you face is lack of available libraries, and being forced to make a few changes every couple months when a new release comes out with breaking changes. Depending on the size of your codebase, that could be a big issue or it could be a 5 minute easy commit.
- Blackstone4 8y agoThank you for adding more color around Crystal. I'm somewhat new to this so bear with me. With regards to the I/O, is it like node.js? i.e. all requests are handled inside a single thread (until Crystal gets parallelism) and when the thread waits for an I/O response (i.e. a database call), it will process some of the other requests?
- RX14 8y agoYep, exactly like that.