Skip to content

Using current_runtime always spawns additional thread. #1736

Closed
@luben

Description

@luben

Running the single_threaded example spawns additional thread (though it is supposed to show that it does not need more threads):

$ ps -eLf | grep 'target/release/examples'
luben     1520 15628  1520  0    2 20:38 pts/18   00:00:00 ./target/release/examples/single_threaded
luben     1520 15628  1521  0    2 20:38 pts/18   00:00:00 ./target/release/examples/single_threaded
luben     1554 24569  1554  0    1 20:38 pts/19   00:00:00 grep --color=auto target/release/examples

My understanding is that the new thread is created by: https://github.com/hyperium/hyper/blob/master/src/server/tcp.rs#L32 but I may be wrong.

I have tried to go lower level using hyper::server::conn but was not able to create a truly single-threaded server. Please advice.

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