<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jul 2, 2016 at 2:00 PM, guy keren <span dir="ltr"><<a href="mailto:guy.choo.keren@gmail.com" target="_blank">guy.choo.keren@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<a href="https://en.wikipedia.org/wiki/Thttpd" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/Thttpd</a></blockquote><div>dont know if it fits my requierments but last version dated 2014 <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
and<br>
<br>
<a href="https://www.lighttpd.net/" rel="noreferrer" target="_blank">https://www.lighttpd.net/</a></blockquote><div>uses fastcgi. fastcgi is multithreaded. <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
both existed before anyone used javascript on server side, as far as i know<br>
<br>
(and they are written in C, not C++)<br>
<br>
--guy<div><div class="h5"><br>
<br>
On 07/02/2016 10:49 AM, Erez D wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
doing some research on servers i found out that i can handle more<br>
connections simultaneously as single threaded.<br>
on thread per connection i have a huge overhead, just think of the<br>
default 2MB stack per connection - 1000 connections is 2GB ram just for<br>
stack.<br>
however as single threaded, i can server connections by the 10,000s(or<br>
even a million).<br>
<br>
later to my surprise, i found out that that was exactly one of the main<br>
considerations behind node.js<br>
<br>
but node.js requires code in js. and i am more of a c++ guy<br>
(and of course c++ is more efficient than js)<br>
<br>
C++ did a long way and now modern c++ (i.e. c++11 / c++14 ) is on par<br>
with other modern languages.<br>
the idea behind c++11/14 was to make it simple for beginners, while<br>
still keeping the option to control every bit for advanced users.<br>
one thing i hear people hate about c and c++ is its memory handling<br>
(malloc/free or new/delete), however in forgot about it years ago using<br>
shared_ptr ( now in c++11 and before that, use boost instead).. you can<br>
still control when it is freed if you want (in countrary to<br>
garbage-disposal-thread languages). as a matter of fact, i use this a<br>
lot - i create an object that cleans up,. and no matter how i exit the<br>
function it gets cleaned up.<br>
<br>
so i wanted a node.c++ instead of writing my own<br>
<br>
in theory simple single threaded web server usage code could look<br>
something like:<br>
<br>
int main()<br>
{<br>
   auto server=HttpServer::create(80,[](Request &request)<br>
     {<br>
       if (request.header=="HelloWorld")<br>
       {<br>
          HttpResponse(200,"<H1>Hello, world</h1>");<br>
       } else {<br>
         File::Read(request,header,[](bool success, string body)<br>
           {<br>
              if (success)<br>
                HttpResponse(400,body);<br>
           } else {<br>
                HttpResponse(404);<br>
           }<br>
         );<br>
       }<br>
     }<br>
   );<br>
}<br>
<br>
<br>
<br>
<br>
On Fri, Jul 1, 2016 at 4:58 AM, Amos Shapira <<a href="mailto:amos.shapira@gmail.com" target="_blank">amos.shapira@gmail.com</a><br></div></div><span class="">
<mailto:<a href="mailto:amos.shapira@gmail.com" target="_blank">amos.shapira@gmail.com</a>>> wrote:<br>
<br>
    I'm curious - what's the background of this question? What's the<br>
    original goal that led you to ask this?<br>
<br>
    On 28 June 2016 at 18:04, Erez D <<a href="mailto:erez0001@gmail.com" target="_blank">erez0001@gmail.com</a><br></span><span class="">
    <mailto:<a href="mailto:erez0001@gmail.com" target="_blank">erez0001@gmail.com</a>>> wrote:<br>
<br>
        i tried searching the web but got no result<br>
<br>
        what web servers other than node.js are single threaded ?<br>
        anyone has experience with one ?<br>
        is there one in which the cgi is in c++ ?<br>
<br>
<br>
<br>
<br>
        _______________________________________________<br>
        Linux-il mailing list<br></span>
        <a href="mailto:Linux-il@cs.huji.ac.il" target="_blank">Linux-il@cs.huji.ac.il</a> <mailto:<a href="mailto:Linux-il@cs.huji.ac.il" target="_blank">Linux-il@cs.huji.ac.il</a>><br>
        <a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" rel="noreferrer" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
<br>
<br>
<br>
<br>
    --<br>
    <<a href="http://au.linkedin.com/in/gliderflyer" rel="noreferrer" target="_blank">http://au.linkedin.com/in/gliderflyer</a>><span class=""><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il" target="_blank">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" rel="noreferrer" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
<br>
</span></blockquote><div class="HOEnZb"><div class="h5">
<br>
<br>
_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il" target="_blank">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" rel="noreferrer" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
</div></div></blockquote></div><br></div></div>