Re: [Quickfix-developers] Re: ThreadedSocketAcceptor Segmentation Faults
Brought to you by:
orenmnero
|
From: Oren M. <or...@qu...> - 2005-11-08 14:58:54
|
Well, my understanding of detach is not that it actually stops a running =
thread, but that it guarantees the resources of that thread will be =
release immiediately when the thread stops running on its own. It =
essentially is an alternative to join when there isn't a need to =
synchronize with another thread.
Why 0 is being passed to this function is most interesting to me. My =
best guess right now is that somehow removeThread is being called before =
addThread. I think perhaps locking the mutex that guards m_threads =
before spawning the thread would do the trick.
--oren
----- Original Message -----=20
From: Caleb Epstein=20
To: Alberto Bellido Rodr=EDguez=20
Cc: qui...@li...=20
Sent: Tuesday, November 08, 2005 7:13 AM
Subject: Re: [Quickfix-developers] Re: ThreadedSocketAcceptor =
Segmentation Faults
On 11/8/05, Alberto Bellido Rodr=EDguez <bellido@3.14financial.com> =
wrote:
#0 0x4048318c in pthread_detach () from /lib/tls/libpthread.so.0
#1 0x400d5edc in FIX::thread_detach (thread=3D0) at Utility.cpp:344
#2 0x4009323f in FIX::ThreadedSocketAcceptor::removeThread
(this=3D0xbffff500, s=3D57) at stl_map.h:332=20
#3 0x40093335 in FIX::ThreadedSocketAcceptor::socketThread =
(p=3D0x3) at
ThreadedSocketConnection.h:51
#4 0x40482b3c in start_thread () from /lib/tls/libpthread.so.0
#5 0x4032092a in clone () from /lib/tls/libc.so.6=20
I really think this call should be changed to a thread_join, at least =
on UNIX systems. Detaching a running thread seems like playing Russion =
Roulette to me.
--=20
Caleb Epstein
caleb dot epstein at gmail dot com |