Giter Site home page Giter Site logo

Thread Pool vs Evented IO about prax.cr HOT 5 CLOSED

ysbaddaden avatar ysbaddaden commented on May 21, 2024
Thread Pool vs Evented IO

from prax.cr.

Comments (5)

ysbaddaden avatar ysbaddaden commented on May 21, 2024

This is tied to what Crystal comes up with. The threaded version was quick to develop.

Attemtps to use the libuv based IO model of Crystal didn't go that well for now β€”it requires to drop the IO.select loops, to find a way around File#reopen (libuv doesn't wrap dup, dup2 or dup3), and certainly more.

This is a long term ticket, to keep up with whatever concurrency/parallelism scheme Crystal thrives for.

from prax.cr.

ysbaddaden avatar ysbaddaden commented on May 21, 2024

Note that since #8 Prax uses a thread pool (fixed to 16) instead of spawning a thread to handle each connection.

from prax.cr.

ysbaddaden avatar ysbaddaden commented on May 21, 2024

Crystal 0.7.0 initiated the move to evented IO by default, and Prax now takes advantage of it since 261f119.

Server sockets (HTTP or HTTPS) are each handled in their own fiber, avoiding the need for IO.select; and client sockets are each handled in their own fiber too (unlimited) to avoid blocking the HTTP[S] servers. Let's see how it goes!

from prax.cr.

asterite avatar asterite commented on May 21, 2024

That's the spirit!! :-) :-) :-)

from prax.cr.

ysbaddaden avatar ysbaddaden commented on May 21, 2024

A part of me would like to keep control over what runs in parallel, but another part just want Erlang actors and not bother with concurrent vs parallel. I wish crystal will allow just that.

from prax.cr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.