Reputation: 33605
I want to use, say, QSemaphore
with boost threads or c++ 11 threads. Is that allowed?
Upvotes: 1
Views: 218
Reputation: 60034
I'm working on pqConsole, where multithreading plays an important role.
Running a console for SWI-Prolog (multithreaded, implemented in C), the Qt GUI manages IO on behalf of user programs, executing in a background QThread, where the foreign language interface is instanced.
Threads can also be initiated from C side, and they get a dedicated console (see interactor/0), where the IO again is rendered on Qt GUI.
I'm using QMutex and QMutexLocker to syncronize (i.e. the simpler constructs), and AFAIK those are performing as expected.
Upvotes: 2
Reputation: 53215
Theoretically, yes, you can.
Note, you could also just use the boost semaphore available with that scenario. Also, QSemaphore currently does not use the pthread interface underneath, but some custom solution. There were discussions to refactor that later for utilizing the pthread features more.
Upvotes: 0