Help me with threads

General discussion about C/C++

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

Help me with threads

Postby noway » Sat Jul 31, 2010 8:49 pm

How to notify main(GUI) thread from second thread about some event?
Needs cross-platform ways (boost , stl , ... ) , except Qt tools.
noway
 
Posts: 2
Joined: Sat Jul 31, 2010 8:44 pm

Re: Help me with threads

Postby noway » Sat Jul 31, 2010 8:51 pm

GUI thread cant be freezing !
noway
 
Posts: 2
Joined: Sat Jul 31, 2010 8:44 pm

Re: Help me with threads

Postby Dante Shamest » Tue Aug 03, 2010 12:29 am

What kind of event?

The main thread can just keep polling a synchronized variable (perhaps stored in a Singleton) to check if your event has occurred. The secondary thread will update the variable if the event has occurred.

Your synchronized polling variable can be a queue if there are multiple secondary threads.
User avatar
Dante Shamest
Moderator
 
Posts: 3131
Joined: Wed Oct 22, 2003 10:29 pm
Location: Malaysia


Return to General

Who is online

Users browsing this forum: Google [Bot] and 1 guest