I have recently been working on a Rust projects that features multithreading.
The application is structured like this:
- A CLI thread (handles stdin etc.)
- The main thread listening for connections (server)
- Each connection is then processed in a different thread.
I have a
stop command that shuts the server down, therefore I need to pass a reference to the
TcpListener in order to
Since I need multiple ownership (the listener is also used for the connections), I use
Arc<TcpListener>, then extract a reference using
as_ref() in the new thread.
Everything works fine, however when I analyze the executable (in release mode) with Valgrind, I get warned that 304 bytes could have been
I can’t manage to find the cause to this nor fix it.
https://github.com/RoccoDev/bbCraft/blob/master/server/mc_server_impl/src/net/mod.rs (Network stuff)
Thank you for any help you’re willing to give.