Hello Vivek,

Once the ThreadManager::Impl is stopped you can not restart it. Is it
possible that the ThreadManager::Impl::stopImpl() method was called prior
to the code you show? If so you will need to destroy the old thread_manager
and create a new one for the next server run.

You can call the ThreadManager::state() method before and after the call to
start() to see what is happening.


  thread_manager->threadFactory(threadfactory);
  std::cout << thread_manager->state();  << std::endl; //or some such
  thread_manager->start();
  std::cout << thread_manager->state();  << std::endl;
  server = new TNonblockingServer(processor, protocolfactory,
                                   port,
                                   thread_manager);
  server->serve();


Best,
Randy



On Tue, Sep 3, 2013 at 12:40 AM, Vivek Goel <[email protected]> wrote:

> I am using thrift C++ library.
>
> My code look like:
>
>   thread_manager->threadFactory(threadfactory);
>   thread_manager->start();
>   server = new TNonblockingServer(processor, protocolfactory,
>                                    port,
>                                    thread_manager);
>   server->serve();
>
>
> Sometimes, while starting the process. I am getting following error:
>
> Thrift: Tue Sep 3 06:54:47 2013 IllegalStateException: Server::process()
> ThreadManager::Impl::add ThreadManager not started
>
>
> regards
> Vivek Goel
>

Reply via email to