thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rush Manbert <r...@manbert.com>
Subject Re: C++ API and external eventloop
Date Thu, 22 Jul 2010 16:59:12 GMT
IIRC, from my tests using the stress test app, TNonBlockingServer seems to be faster than any
of the others in Windows.

But be sure to do your own tests, because it's been a while since I was doing thisd.

- Rush

On Jul 22, 2010, at 7:31 AM, Bryan Duxbury wrote:

> If the C++ NonblockingServer is like the Java one, which I think it is, then
> it uses nonblocking IO to communicate with clients in a single thread, and
> then performs the method invocations either in that same thread or in a
> limited threadpool. The purpose is to avoid having to have a thread per
> connection.
> 
> ThreadPoolServer uses a thread per client connection (up to a certain limit)
> and performs the IO and invocation in that thread. You run the risk of
> having slow connections take up a thread for a long time and blocking other
> invocations from occurring. At least in the Java ThreadPoolServer, you also
> have the issue that it's not a "fair" server - that is, once a socket is
> assigned to a thread from the pool, that thread will remain busy until the
> socket is *closed*, meaning that you need to have as many threads as you
> want to have concurrent connections, not just concurrent method executions.
> 
> -Bryan
> 
> On Thu, Jul 22, 2010 at 7:15 AM, 萧超杰 <chjxiao@gmail.com> wrote:
> 
>> so what is the differences between TNonBlockingServer and
>> TThreadPoolServer?
>> 
>> 2010/7/22 Łukasz Michalik <lmi@ift.uni.wroc.pl>
>> 
>>> On 16:34 2010-07-22 +0800, 萧超杰 wrote:
>>>> if i use TThreadPoolServer is this server a nonblocking server?
>>>> 
>>> 
>>> It is nonblocking in the sense, that it doesn't block, but keep in
>>> mind that it spawns a thread (or uses one from pool) each time a
>>> client connects.
>>> 
>>> --
>>> A: Because it messes up the order in which people normally read text.
>>> Q: Why is top-posting such a bad thing?
>>> A: Top-posting.
>>> Q: What is the most annoying thing on usenet and in e-mail?
>>> 
>>> Pozdrawiam,
>>> Łukasz P. Michalik
>>> 
>> 


Mime
View raw message