Creating a boost thread in a matlab mex file causes matlab to crash

I'm having some issues getting matlab and boost threads to work together. I'm
posting here and a number of other places as I don't think this problem fits
into any one domain.
Specifically, whenever I try to use boost threads within a mex file, it
causes matlab to crash.
My test program is:
#include

bjs109 wrote:
I'm having some issues getting matlab and boost threads to work together. I'm posting here and a number of other places as I don't think this problem fits into any one domain.
Specifically, whenever I try to use boost threads within a mex file, it causes matlab to crash.
...[snip]...
Any ideas?
First thought. Have you tried a similar program that does not use boost threads, but instead creates the threads directly via pthreads? If this also crashes the same way, then boost threads is not the cause of the problem. If it does not crash, then boost threads is involved in the problem. Second thought. If you find that boost threads is involved in the problem, you might try updating your boost installation to the current version (1.39). The version included with your CentOS is more than 3 1/2 years old, and according to Anthony's release notes almost every line of the code has been rewritten since then. That is at least the steps I would start with. John

All very logical steps, and steps which I'm sure I tried at some point ;)
Firstly, the posix threads solution works just fine, I've included the
program I tested (a slight modification of a standard example program).
/*
* p_hello.c -- a hello program (in pthread)
*/
#include "mex.h"
#include
participants (2)
-
bjs109
-
John Phillips