You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to me there is a problem when using a Poco::Thread on linux when you do not call join() on it and the thread function simply finishes before the Thread object destructor is called.
The destructor only calls pthread_detach() if isRunningImpl() is true, but if the ThreadImpl::runnableEntry(void* pThread) function finishes, it will set pData->pRunnableTarget = 0, so isRunningImpl() will return false then.
This causes the virtual memory usage of the process to increase with every thread, an after a few hundred started&stopped threads you will get "cannot start thread" exceptions.
Thread_POSIX.cpp:
ThreadImpl::~ThreadImpl()
{
if (isRunningImpl())
pthread_detach(_pData->thread);
}
The text was updated successfully, but these errors were encountered:
http://pocoproject.org/forum/viewtopic.php?f=12&t=5760
by rd » Thu Feb 07, 2013 5:43 am
Hi,
It seems to me there is a problem when using a Poco::Thread on linux when you do not call join() on it and the thread function simply finishes before the Thread object destructor is called.
The destructor only calls pthread_detach() if isRunningImpl() is true, but if the ThreadImpl::runnableEntry(void* pThread) function finishes, it will set pData->pRunnableTarget = 0, so isRunningImpl() will return false then.
This causes the virtual memory usage of the process to increase with every thread, an after a few hundred started&stopped threads you will get "cannot start thread" exceptions.
Thread_POSIX.cpp:
The text was updated successfully, but these errors were encountered: