Skip to content
Discussion options

You must be logged in to vote

Hey Josh,

Yes, Rage is purposefully single-threaded and quite similar to how Node.js works. There are a couple of reasons for this:

  • We extensively use fibers. However, one limitation of fibers is that they have to be resumed from the same thread they were paused in, which makes scheduling a bit complicated.
  • Threaded code is very difficult to work with. Using a single-threaded approach makes the codebase much simpler and more stable, and also removes a lot of overhead coming from synchronisation primitives.

If your workflow involves CPU-bound tasks, you can use the multi-worker mode to run Rage in multiple processes:

Rage.configure do
  config.server.workers_count = -1 # run as many work…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@joshdvir
Comment options

@rsamoilov
Comment options

Answer selected by joshdvir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants