views:

53

answers:

2

I'm trying to parallelize a number-crunching part of an application to make use of a quad-core architecture using OpenMP and GCC 4.2 on Mac OS 10.5. But what I think the problem is that this application uses Qt for the GUI and I'm trying to fork the worker threads on a secondary thread created by Qt which causes the program to crash - but of this I'm not sure.

I'm seriously on the dark here since it's my first time working with either Qt or OpenMP, (or C++ for that matter). Any sort of guidance is greatly appreciated.

A: 
  1. Does the part using OpenMP work standalone, i.e. when not running in a Qt thread?
  2. Can you maybe tackle your problem using QtConcurrent or some other solution from the thread support in Qt?
  3. In any case, can you provide some of your code for illustration? Usually that makes matters a lot easier.
Greg S
A: 

At the moment this does not work. I think it even was reported as a bug in Qt and gcc - if I remember correctly. It was reported several times (e.g. here). It works with some gcc/Qt combinations at least on linux.

FFox
Commenting myself here. Using the as of today latest macports gcc build (gcc version 4.5.1), the problem is resolved. Having openmp threads started from within a worker QThread works like it should.
FFox