Question

I have a GUI application, which listens to a network port from a second thread. I was looking at OpenMP and I was wondering if there are easy ways to create threads like this. I was searching for documentation, but the OpenMP site is not very convenient to navigate. Could someone help?

Was it helpful?

Solution

As far as I understand OpenMP is a compiler-assisted parallelizing framework/library targeted to heavy computations. You hint the compiler which parts of your code (usually loops) can run in parallel. The compiler does its magic (inserting library calls, sharing/unsharing variables, etc.) and, poof, the program can now run faster (sometimes) on several cores. It might be possible to do what you want with OpenMP, I don't know, but I think you are looking at the wrong tool. Doing things directly with pthreads is one alternative.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top