Processing a GUI stream in a program using OpenMP

I have a C ++ program that does parallel computing using OpenMP. Now this program should also respond to user input and update some graphics. So far, I started my calculations from the main / GUI thread, carefully balancing the workload so that it is neither small to mask the overhead of OpenMP streams, nor for a long time, so the graphical interface becomes unresponsive.

Obviously, I would like to fix this by doing everything all at once. As far as I can tell, OpenMP 2.5 does not provide a good mechanism for this. I guess it was not intended for this problem. I also do not want to allocate the whole kernel for the GUI thread, it just needs <10% of its work.

I thought that splitting the calculation into a separate pthread that runs parallel constructs would be a good way to solve this. I encoded this, but had OpenMP crash when called from pthread, similar to this error: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36242 . Please note that I did not try to run parallel constructs from more than one thread at a time, OpenMP was used in only one pthread in the whole program.

It seems that I cannot use OpenMP to schedule my GUI at the same time and not use pthreads for parallel work of parallel constructs. I thought that I simply process the work with the GUI in a separate thread, but in my case it is quite ugly and may not work due to the use of various libraries.

What kind of textbook is this? I am sure that others used OpenMP in a program that should work simultaneously with a graphical interface / network, etc., but I could not find any information using Google or the OpenMP forum.

Thank!

+3
source share
1 answer

. OpenMP - , , , ~ #CPU . , , .

, , , ​​ GCC OpenMP. GCC , , OpenMP IPC. (, / .)

0

All Articles