Mary
Mary

Reputation: 1

Thread synchronization problem

I use Qt and C++. I have a list of threads (Qlist<QtThread>).

I try to synchronize them. All threads calculate some values. And I want to take them.

Have you any ideas? thank a lot

Upvotes: 0

Views: 296

Answers (2)

Mat
Mat

Reputation: 206879

Your question is a bit broad, but Qt has a lot of documentation on different thread synchronization methods.

The base of the docs is at Threading Support in Qt. The specific part you should find the info in is the Synchronizing Threads section. It lists the various mutex, locks, semaphores, wait conditions that are available in the Qt framework.

The documentation for all these classes has example usage code. Also have a look at the Threading and Concurrent Programming Examples, you'll probably find what you're after in there.

Upvotes: 1

O.C.
O.C.

Reputation: 6829

You can use the finished() signal of a thread to execute a slot when your thread finishes executing.

Upvotes: 1

Related Questions