multi threading problem

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Fire Lancer
Knows some wx things
Knows some wx things
Posts: 31
Joined: Sat Sep 06, 2008 10:49 am

multi threading problem

Post by Fire Lancer » Sat Sep 06, 2008 3:28 pm

My app includes a real time component, which is running in it's own thread.

The problem is I need to prevent wxWidgets from changing certain things for during the rendering to ensure that the area i'm rendering fits on the panel for that frame (eg there is no chance of displaying "old" areas of the backbuffer that frame because I rendered for 300*300 and it got resized to 350*300)

I can add a critical section to my code quite easy, but how do I make it so that wxWidgets needs to aquire the lock before updating the panels size?
Last edited by Fire Lancer on Fri Sep 12, 2008 7:13 am, edited 1 time in total.

Ugly!
Earned some good credits
Earned some good credits
Posts: 113
Joined: Mon May 09, 2005 5:11 am
Location: Argentina - BS AS

Re: multi threading problem

Post by Ugly! » Tue Sep 09, 2008 4:23 am

Fire Lancer wrote:My app includes a real time component, which is running in it's own thread.

The problem is I need to prevent wxWidgets from changing certain things for during the rendering to ensure that the area i'm rendering fits on the panel for that frame (eg there is no chance of displaying "old" areas of the backbuffer that frame because I rendered for 300*300 and it got resized to 350*300)

I can add a critical section to my code quite easy, but how do I make it so that wxWidgets needs to aquire the lock before updating the panels size?
What about having the thread to send an event to the parent window when it´s safe to repaint?

Regards, Mat
Just a newbie - Too many interests, not too many time.

Windows XP SP2
Kubuntu GNU/Linux - Feisty
wxActiveRecordGenerator (aka wxARG) maintainer
Find it at wxCode

Post Reply