Skip to content

Multi process #400

Open
Open

Description

@rj314

I know Crow server supports multi-threading. However, the legacy code base that I would like to use Crow with is not thread-safe.
Given that, I am wondering how difficult it is to add multi-process capability to Crow (instead of creating a new thread for each incoming request, fork a new process).

Activity

  1. The-EDev commented on Nov 24, 2021

    @The-EDev

    Hello @rj314.
    I'll start off by mentioning that this repository has been abandoned for about 4 years now, I suggest you use this repository instead.

    With that being said. Crow does not create a new thread per request. it starts with an acceptor thread and a number of worker threads. each worker thread is then assigned a number of incoming connections by the acceptor thread in a round-robin way. Each thread has its own asio::io_context which is used to manage the connections assigned to it.
    I'm not sure how you can transform this to multiple processes, but most (if not all) of your changes would be inside the crow::server class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions