boost::signals + pthreads = seg fault on Linux
Hi,
I have a problem with boost::signals when I try to use them in multi threaded
projects. I have tried gcc 3.2.3 and gcc 3.3.2, on two different Linux boxes,
with the same result. The following test program works fine w/o threads and
crashes after the 17th call to connect if I add -pthread to the compile
command:
#include
Uwe Sander wrote:
Hi,
I have a problem with boost::signals when I try to use them in multi threaded projects. I have tried gcc 3.2.3 and gcc 3.3.2, on two different Linux boxes, with the same result. The following test program works fine w/o threads and crashes after the 17th call to connect if I add -pthread to the compile command:
The first pitfall I hit using signals in a multi-threaded environment is that the signals lib by default (on win32 anyway) builds a single threaded library, NOT multi-threaded. You have to explicitly force a multi-threaded build for it using <threading>multi as a BUILD option of bjam. HTH Russell
Hi (again), Am Donnerstag, 8. Januar 2004 19:00 schrieb Russell Hind:
The first pitfall I hit using signals in a multi-threaded environment is that the signals lib by default (on win32 anyway) builds a single threaded library, NOT multi-threaded. You have to explicitly force a multi-threaded build for it using
<threading>multi
as a BUILD option of bjam.
HTH
Indeed, at least the demo code I have sent in works w/o any trouble now, thank you :-) I will try our project at work tomorrow and report back if there are still problems. BTW, I could not find this build option in the boost docs; am I blind? Thanks again Uwe
Uwe Sander wrote:
Indeed, at least the demo code I have sent in works w/o any trouble now, thank you :-) I will try our project at work tomorrow and report back if there are still problems. BTW, I could not find this build option in the boost docs; am I blind?
I haven't had much success understanding the build docs either, someone posted a simple link ages ago for me to build with borland which was bjam -sTOOLS=borland -sBUILD="release <threading>multi <runtime-link>static" (or something like that). I haven't tried any other configurations. I have now created my own C++BuilderX project file for building the libraries I use so no-longer use bjam anyway. Thanks Russell
participants (2)
-
Russell Hind
-
Uwe Sander