Hi, Openmp is a MinGW64 problem, mixing pthreads with openmp is buggy.

Currently I am trying to debug this in their winpthread implementation
but I am no thread expert. Not by far. Any help is welcome.
I have downloaded their svn repository and winpthread is in
experimental/winpthread folder. Standard configure/make with CFLAGS=-g
is enough to get a debug build. Also MSYS is required.

Warning! Uncommented and unindented code in there, prepare for eyesores :p

A minimum test case to reproduce the hang is (compile with -fopenmp)

#include <cstdio>
#include <omp.h>
#include <pthread.h>

void *do_thread(void *) {       
        int niterations = 200;
        int i;

        #pragma omp parallel for
        for (i = 0; i < niterations; i++)
        {
                printf ("ducks\n");
        }

        return NULL;
}

int main() {
        pthread_t id;
        
        pthread_create(&id, NULL, do_thread, NULL);
        pthread_join (id, NULL);
}
_______________________________________________
Bf-committers mailing list
Bf-committers@blender.org
http://lists.blender.org/mailman/listinfo/bf-committers

Reply via email to