Menu

#76 pthreads / OpenMP do not interoperate.

closed
nobody
GCC (115)
7
2012-09-27
2009-12-27
No

pthreads / OpenMP do not interoperate (i.e. crash).
Under Linux this works well with my gcc version 4.4.1.
A sample test is in attachment.
Remark : pthreads without OpenMP => works.
Remark : OpenMP without (started) threads => works.

I'm pretty desperate for the functionality : I have a raw image processor with multiple threads (ie gui and workers) and I cannot 'openmp' the workers. OpenMP adds quite some speed to image processing.

Thanks for all your efforts and feedback.

Jos

Discussion

  • Jos De Laender

    Jos De Laender - 2009-12-27

    Crashing example.

     
  • Jos De Laender

    Jos De Laender - 2010-01-22

    I drafted a potential patch. It is in libgomp.
    http://jdlraw.sourceforge.net/GompPatch.shtml

     
  • John E.

    John E. - 2010-04-19

    I can't reproduce the problem on Win 7 64-bit.

     
  • Jos De Laender

    Jos De Laender - 2010-04-20

    With all due respect, but I believe you might be closing this too soon.

    I'm working on a 32 bit machine and Win XP, and the bug has been confirmed on several places.
    (it's due to TLS issue in pthreads-win32)

    The suggested patch - which would make it work on a stock tdm delivery for 32 bit - is on http://jdlraw.sourceforge.net/GompPatch.shtml

    Best regards,

    Jos

     
  • John E.

    John E. - 2010-04-26

    The patch doesn't apply cleanly to GCC 4.5.0. Can you generate a unified diff with context, please?

     
  • Jos De Laender

    Jos De Laender - 2010-04-27

    I'm not sure what to do or how to do it.

    http://jdlraw.sourceforge.net/GompPatch.shtml contains diff files against 4.4.1

    Jos

     
  • John E.

    John E. - 2010-04-27

    I'll try the diffs with 4.4.1 sources when I get a chance, but for future reference, unified diffs with context are preferred in most cooperative scenarios. They can be applied automatically with "fuzz" in situations where the file has changed but the context is still recognizable, they can be applied by hand, and they are easier for a human to parse. If you use the "diff" tool, try the "-u" flag. Other tools, such as Subversion or your VCS of choice, typically generate unified diffs by default or have the option to do so.

     
  • John E.

    John E. - 2010-04-28

    Didn't apply cleanly to 4.4.1 sources either. I'd really like to test this patch out for the next TDM-GCC release -- but I'd really like to get the next TDM-GCC release out the door as well. If you can post a working patch within the next week, I'll see what I can do, otherwise it'll have to wait for the next release.

     
  • Jos De Laender

    Jos De Laender - 2010-04-29

    Dear,

    You are right, I apparently messed up the diff files on my site. (the originals are correct though).

    For summary I add here (and on the site) the hopefully correct ones as follows :

    team_ori.c : The original team.c as found under gcc-4.4.1/libgomp
    libgomp_ori.h : The same for libgomp.h
    team.c : My changed one
    libgomp.h : My changed one.
    *.patch obtained by diff -u team_ori.c team.c > team_c.patch and the same for libgomp.

    Hope this gives you all needed info and sorry for the mistake.
    Luckily the changed code itself does extremely stable in my case :)

    Jos

     
  • Jos De Laender

    Jos De Laender - 2010-04-29
     
  • Jos De Laender

    Jos De Laender - 2010-04-29
     
  • Jos De Laender

    Jos De Laender - 2010-04-29
     
  • Jos De Laender

    Jos De Laender - 2010-04-29
     
  • Jos De Laender

    Jos De Laender - 2010-04-29
     
  • Jos De Laender

    Jos De Laender - 2010-04-29
     
  • John E.

    John E. - 2010-06-08

    I've applied your patch in the 4.5.0 release, and the testcase appears to work. Please confirm if possible.

     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Anonymous
Anonymous

Add attachments
Cancel