3 ms·
Parallel rendering of an HTML page means an improvement of one renderer to 2 or more renderers. Writing a web server means possibly handling thousands to millio
by rubiquity 12y ago
Parallel rendering of an HTML page means an improvement of one renderer to 2 or more renderers. Writing a web server means possibly handling thousands to millions of concurrent requests, which isn't really doable with Rusts 1:1 threading model.
But the reality of concurrency and hardware is that all we have at the end of the day are threads anyway. So in Rust you could have a thread running an event-loop that serves your web sockets. People are building these sorts of abstractions for Rust but they are a work in progress as far as I know. MIO[0] is one such example.
Rust is a programming language for systems programming and "server side programming" is just a subset of systems programming.
0 - https://github.com/carllerche/mio https://github.com/carllerche/mio
- bsaul 12y agoThanks for your enlightening response. Wouldn't building event loop based server require non-blocking i/o libraries ? Does rust have that ?
- rubiquity 12y agoTo the best of my knowledge Rust's stdlib doesn't have non-blocking libraries yet. But since Rust is "close to the metal" you can easily use any of the non-blocking system calls in glibc. Mio (https://github.com/carllerche/mio#features https://github.com/carllerche/mio#features) seems to be doing just that.
- kxo 12y agoThat's exactly what they require. mio is one such example, I am working on another implementation.