thrift 小坑
1)TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
同时只有一个请求可以访问。 并非会失败
2)TThreadedServer server(processor, serverTransport, transportFactory, protocolFactory);
每个请求一个线程
3)
boost::shared_ptr< PlatformThreadFactory> platformThreadFactory ( new PlatformThreadFactory);
threadManager->threadFactory( platformThreadFactory);
threadManager->start();
// This server allows "workerCount" connection at a time, and reuses threads
TThreadPoolServer server(processor, serverTransport, transportFactory, protocolFactory, threadManager);
工作线程数可控。 但是如果并发超过设置,会有客户端会异常

浙公网安备 33010602011771号